├── .github └── workflows │ ├── build-cli.yml │ ├── ci.yml │ └── run-cargo-bin-and-ensure-no-changes.yml ├── .gitignore ├── .npmrc ├── .pre-commit-config.yaml ├── .prettierignore ├── .prettierrc.json ├── Cargo.lock ├── Cargo.toml ├── LICENSE-MIT ├── README.md ├── assets ├── isograph_logo.ico └── isograph_logo.png ├── bacon.toml ├── crates ├── common_lang_types │ ├── Cargo.toml │ └── src │ │ ├── absolute_and_relative_path.rs │ │ ├── lib.rs │ │ ├── location.rs │ │ ├── path_and_content.rs │ │ ├── selectable_name.rs │ │ ├── span.rs │ │ ├── string_key_types.rs │ │ ├── string_types.rs │ │ ├── text_with_carats.rs │ │ └── type_and_field.rs ├── generate_artifacts │ ├── Cargo.toml │ └── src │ │ ├── eager_reader_artifact.rs │ │ ├── entrypoint_artifact.rs │ │ ├── format_parameter_type.rs │ │ ├── generate_artifacts.rs │ │ ├── imperatively_loaded_fields.rs │ │ ├── import_statements.rs │ │ ├── iso_overload_file.rs │ │ ├── lib.rs │ │ ├── normalization_ast_text.rs │ │ ├── reader_ast.rs │ │ └── refetch_reader_artifact.rs ├── graphql_lang_types │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── graphql_directives.rs │ │ ├── graphql_sdl.rs │ │ ├── graphql_type_annotation.rs │ │ ├── lib.rs │ │ ├── value.rs │ │ └── write.rs ├── graphql_network_protocol │ ├── Cargo.toml │ └── src │ │ ├── graphql_network_protocol.rs │ │ ├── lib.rs │ │ ├── process_type_system_definition.rs │ │ ├── query_text.rs │ │ └── read_schema.rs ├── graphql_schema_parser │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── description.rs │ │ ├── lib.rs │ │ ├── parse_schema.rs │ │ ├── peekable_lexer.rs │ │ └── schema_parse_error.rs ├── impl_base_types_macro │ ├── Cargo.toml │ └── src │ │ ├── impl_base_types.rs │ │ └── lib.rs ├── isograph_cli │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── main.rs │ │ └── opt.rs ├── isograph_compiler │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── add_selection_sets.rs │ │ ├── batch_compile.rs │ │ ├── compiler_state.rs │ │ ├── create_schema.rs │ │ ├── isograph_literals.rs │ │ ├── lib.rs │ │ ├── source_files.rs │ │ ├── watch.rs │ │ ├── with_duration.rs │ │ └── write_artifacts.rs ├── isograph_config │ ├── Cargo.toml │ └── src │ │ ├── compilation_options.rs │ │ ├── lib.rs │ │ └── main.rs ├── isograph_fixture_tests │ ├── Cargo.toml │ └── src │ │ ├── config_for_test.rs │ │ └── main.rs ├── isograph_lang_parser │ ├── Cargo.toml │ ├── README.md │ ├── fixtures │ │ ├── commented-out.input.js │ │ ├── commented-out.output │ │ ├── entrypoint-basic.input.js │ │ ├── entrypoint-basic.output │ │ ├── entrypoint-with-directives.input.js │ │ ├── entrypoint-with-directives.output │ │ ├── entrypoint-with-selection-set.input.js │ │ ├── entrypoint-with-selection-set.output │ │ ├── field-args-array.input.js │ │ ├── field-args-array.output │ │ ├── field-args-boolean.input.js │ │ ├── field-args-boolean.output │ │ ├── field-args-enum.input.js │ │ ├── field-args-enum.output │ │ ├── field-args-null.input.js │ │ ├── field-args-null.output │ │ ├── field-args-number.input.js │ │ ├── field-args-number.output │ │ ├── field-args-obj.input.js │ │ ├── field-args-obj.output │ │ ├── field-args-string.input.js │ │ ├── field-args-string.output │ │ ├── field-args-variable.input.js │ │ ├── field-args-variable.output │ │ ├── field-directives-after-open-curly.input.js │ │ ├── field-directives-after-open-curly.output │ │ ├── field-directives-on-definition-invalid.input.js │ │ ├── field-directives-on-definition-invalid.output │ │ ├── field-directives-on-definition-valid.input.js │ │ ├── field-directives-on-definition-valid.output │ │ ├── field-directives-on-linked-invalid.input.js │ │ ├── field-directives-on-linked-invalid.output │ │ ├── field-directives-on-linked-valid.input.js │ │ ├── field-directives-on-linked-valid.output │ │ ├── field-directives-on-scalar-invalid.input.js │ │ ├── field-directives-on-scalar-invalid.output │ │ ├── field-directives-on-scalar-valid.input.js │ │ ├── field-directives-on-scalar-valid.output │ │ ├── field-empty-linked-field-selection-set.input.js │ │ ├── field-empty-linked-field-selection-set.output │ │ ├── field-empty-selection-set.input.js │ │ ├── field-empty-selection-set.output │ │ ├── field-grabbag-field-set.input.js │ │ ├── field-grabbag-field-set.output │ │ ├── field-multi-line-description.input.js │ │ ├── field-multi-line-description.output │ │ ├── field-no-field-name.input.js │ │ ├── field-no-field-name.output │ │ ├── field-no-parens.input.js │ │ ├── field-no-parens.output │ │ ├── field-no-type-name.input.js │ │ ├── field-no-type-name.output │ │ ├── field-single-line-description.input.js │ │ ├── field-single-line-description.output │ │ ├── field-unclosed.input.js │ │ ├── field-unclosed.output │ │ ├── pointer-basic.input.js │ │ ├── pointer-basic.output │ │ ├── pointer-directives.input.js │ │ └── pointer-directives.output │ └── src │ │ ├── description.rs │ │ ├── isograph_literal_parse_error.rs │ │ ├── lib.rs │ │ ├── parse_iso_literal.rs │ │ ├── peekable_lexer.rs │ │ └── token_kind.rs ├── isograph_lang_types │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── base_types.rs │ │ ├── client_field_declaration.rs │ │ ├── client_field_directive_set.rs │ │ ├── entrypoint_declaration.rs │ │ ├── entrypoint_directive_set.rs │ │ ├── id_types.rs │ │ ├── isograph_directives.rs │ │ ├── isograph_type_annotation.rs │ │ ├── lib.rs │ │ ├── selection_directive_set.rs │ │ ├── source_types.rs │ │ ├── with_id.rs │ │ └── with_target_entity_id.rs ├── isograph_lsp │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── lsp_notification_dispatch.rs │ │ ├── lsp_process_error.rs │ │ ├── lsp_request_dispatch.rs │ │ ├── lsp_runtime_error.rs │ │ ├── lsp_state.rs │ │ ├── row_col_offset.rs │ │ ├── semantic_tokens │ │ ├── client_field.rs │ │ ├── entrypoint.rs │ │ ├── mod.rs │ │ ├── semantic_token_generator.rs │ │ └── semantic_token_legend.rs │ │ ├── server.rs │ │ └── text_document.rs ├── isograph_schema │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── accessible_client_fields_iterator.rs │ │ ├── create_additional_fields │ │ ├── add_link_fields.rs │ │ ├── argument_map.rs │ │ ├── create_additional_fields_error.rs │ │ ├── expose_field_directive.rs │ │ └── mod.rs │ │ ├── create_merged_selection_set.rs │ │ ├── data_model │ │ ├── client_selectables.rs │ │ ├── entities.rs │ │ ├── mod.rs │ │ ├── server_selectables.rs │ │ └── traits │ │ │ ├── client_or_server_object_selectable.rs │ │ │ ├── client_scalar_or_object_selectable.rs │ │ │ ├── mod.rs │ │ │ ├── scalar_or_object_entity.rs │ │ │ └── server_scalar_or_object_selectable.rs │ │ ├── definition_location_fns.rs │ │ ├── field_loadability.rs │ │ ├── isograph_schema.rs │ │ ├── lib.rs │ │ ├── network_protocol.rs │ │ ├── object_type_definition.rs │ │ ├── process_client_field_declaration.rs │ │ ├── refetch_strategy.rs │ │ ├── root_types.rs │ │ ├── validate_argument_types.rs │ │ ├── validate_entrypoint.rs │ │ ├── validate_use_of_arguments.rs │ │ ├── variable_context.rs │ │ └── visit_selection_set.rs ├── pico │ ├── Cargo.toml │ ├── src │ │ ├── database.rs │ │ ├── dependency.rs │ │ ├── derived_node.rs │ │ ├── dyn_eq.rs │ │ ├── epoch.rs │ │ ├── execute_memoized_function.rs │ │ ├── garbage_collection.rs │ │ ├── index.rs │ │ ├── intern.rs │ │ ├── lib.rs │ │ ├── macro_fns.rs │ │ ├── memo_ref.rs │ │ ├── retained_query.rs │ │ └── source.rs │ └── tests │ │ ├── basic.rs │ │ ├── basic_multi_function_chain.rs │ │ ├── cyclic_dependency_panic.rs │ │ ├── garbage_collection │ │ ├── basic_gc.rs │ │ ├── inner_retained.rs │ │ ├── multiple_calls.rs │ │ ├── outer_retained.rs │ │ ├── retained.rs │ │ └── retained_and_in_lru.rs │ │ ├── intern.rs │ │ ├── overriding_same_source.rs │ │ ├── params │ │ ├── memo_ref_never_cloned.rs │ │ ├── other_param_cloned_on_execute.rs │ │ └── source_id_never_cloned.rs │ │ ├── partial_reuse_multi_function.rs │ │ ├── partial_reuse_single_chain.rs │ │ ├── removing_params.rs │ │ ├── return_value_not_cloned.rs │ │ ├── same_source_key.rs │ │ ├── side_chain.rs │ │ ├── singleton.rs │ │ ├── store_memo_ref.rs │ │ ├── tests.rs │ │ └── unrelated_source_change.rs ├── pico_macros │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ ├── memo_macro.rs │ │ ├── singleton.rs │ │ └── source.rs ├── string_key_newtype │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── swc_isograph_plugin │ ├── Cargo.toml │ ├── README.md │ ├── src │ │ └── lib.rs │ └── tests │ │ ├── fixtures │ │ ├── base │ │ │ ├── should_return_an_identity_for_non_called_iso_function │ │ │ │ ├── input.js │ │ │ │ ├── isograph.config.json │ │ │ │ └── output.js │ │ │ ├── should_transform_iso_fn_to_a_import_call │ │ │ │ ├── input.js │ │ │ │ ├── isograph.config.json │ │ │ │ └── output.js │ │ │ ├── should_transform_iso_fn_to_a_require_call │ │ │ │ ├── input.js │ │ │ │ ├── isograph.config.json │ │ │ │ └── output.js │ │ │ └── should_transform_nested_calls_to_iso │ │ │ │ ├── input.js │ │ │ │ ├── isograph.config.json │ │ │ │ └── output.js │ │ └── errors │ │ │ ├── invalid_iso_keyword │ │ │ ├── input.js │ │ │ ├── isograph.config.json │ │ │ ├── output.js │ │ │ └── output.stderr │ │ │ └── one_arg_only_for_iso_function │ │ │ ├── input.js │ │ │ ├── isograph.config.json │ │ │ ├── output.js │ │ │ └── output.stderr │ │ └── transform.rs ├── tests │ ├── Cargo.toml │ ├── src │ │ └── lib.rs │ └── tests │ │ ├── directives_deserialization.rs │ │ └── fixtures │ │ └── directives │ │ ├── mutation_extension_extra_nestedfield.graphql │ │ ├── mutation_extension_extra_toplevelfield.graphql │ │ ├── mutation_extension_missing_nestedfield.graphql │ │ ├── mutation_extension_missing_toplevelfield.graphql │ │ ├── mutation_extension_valid.graphql │ │ └── mutation_extension_valid_as.graphql ├── u32_newtypes │ ├── Cargo.toml │ └── src │ │ └── lib.rs └── u64_newtypes │ ├── Cargo.toml │ └── src │ └── lib.rs ├── demos ├── disposable-state-ajax-demo │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── next.config.js │ ├── package.json │ ├── src │ │ ├── components │ │ │ ├── Card.tsx │ │ │ ├── LazyLoadPostsPage.tsx │ │ │ ├── PreloadedPostsPage.tsx │ │ │ ├── PromiseWrapper.ts │ │ │ ├── api.ts │ │ │ └── networkTypes.ts │ │ └── pages │ │ │ ├── _app.tsx │ │ │ ├── _document.tsx │ │ │ ├── lazy-loaded.tsx │ │ │ └── preloaded.tsx │ ├── tsconfig.json │ └── yarn.lock ├── github-demo │ ├── .babelrc.json │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── isograph.config.json │ ├── next.config.js │ ├── package.json │ ├── schema.graphql │ ├── scripts │ │ └── deploy.sh │ ├── src │ │ ├── .eslintignore │ │ ├── isograph-components │ │ │ ├── CommentList.tsx │ │ │ ├── GithubDemo.tsx │ │ │ ├── HomePageList.tsx │ │ │ ├── HomeRoute.tsx │ │ │ ├── PullRequestDetail.tsx │ │ │ ├── PullRequestLink.tsx │ │ │ ├── PullRequestRoute.tsx │ │ │ ├── PullRequestTable.tsx │ │ │ ├── RepoGitHubLink.tsx │ │ │ ├── RepositoryDetail.tsx │ │ │ ├── RepositoryLink.tsx │ │ │ ├── RepositoryRoute.tsx │ │ │ ├── UserDetail.tsx │ │ │ ├── UserLink.tsx │ │ │ ├── UserRepositoryList.tsx │ │ │ ├── UserRoute.tsx │ │ │ ├── __isograph │ │ │ │ ├── Actor │ │ │ │ │ ├── UserLink │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ └── asUser │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ ├── IssueComment │ │ │ │ │ └── formattedCommentCreationDate │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ ├── PullRequest │ │ │ │ │ ├── CommentList │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PullRequestLink │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ └── createdAtFormatted │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ ├── PullRequestConnection │ │ │ │ │ └── PullRequestTable │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ ├── Query │ │ │ │ │ ├── Header │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── HomePage │ │ │ │ │ │ ├── __refetch__0.ts │ │ │ │ │ │ ├── __refetch__query_text__0.ts │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── HomePageList │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PullRequest │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PullRequestDetail │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── RepositoryDetail │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── RepositoryPage │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── UserDetail │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ └── UserPage │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ ├── Repository │ │ │ │ │ ├── IsStarred │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── RepositoryLink │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ └── RepositoryRow │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ ├── User │ │ │ │ │ ├── Avatar │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── RepositoryConnection │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ ├── refetch_reader.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── RepositoryList │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ └── __refetch │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ └── refetch_reader.ts │ │ │ │ └── iso.ts │ │ │ ├── avatar.tsx │ │ │ ├── header.tsx │ │ │ └── svgs │ │ │ │ ├── dark-logo.svg │ │ │ │ └── light-logo.svg │ │ └── pages │ │ │ ├── _app.tsx │ │ │ ├── _document.tsx │ │ │ └── index.tsx │ └── tsconfig.json ├── pet-demo │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── backend │ │ ├── package.json │ │ ├── schema-extension.graphql │ │ ├── schema.graphql │ │ └── src │ │ │ ├── index.js │ │ │ ├── newsfeed.js │ │ │ └── schema.js │ ├── isograph.config.json │ ├── next.config.js │ ├── package.json │ ├── pages │ │ ├── _app.tsx │ │ ├── _document.tsx │ │ ├── index.tsx │ │ ├── newsfeed.tsx │ │ └── pet │ │ │ ├── [id].tsx │ │ │ ├── [id] │ │ │ └── checkin-list.tsx │ │ │ ├── by-name │ │ │ └── [name].tsx │ │ │ └── with-defer │ │ │ └── [id].tsx │ ├── public │ │ ├── henry.jpg │ │ ├── kiki.jpg │ │ ├── makayla.jpg │ │ ├── makayla_2.jpg │ │ ├── makayla_3.jpg │ │ ├── mimi.jpg │ │ ├── rezor.jpg │ │ └── tiberius.jpg │ ├── src │ │ ├── components │ │ │ ├── ErrorBoundary.tsx │ │ │ ├── FavoritePhrase.tsx │ │ │ ├── HomeRoute.tsx │ │ │ ├── Newsfeed │ │ │ │ ├── AdItem.tsx │ │ │ │ ├── AdItemDisplayWrapper.tsx │ │ │ │ ├── BlogItem.tsx │ │ │ │ ├── BlogItemMoreDetail.tsx │ │ │ │ ├── ImageDisplay.tsx │ │ │ │ ├── NewsfeedPagination.tsx │ │ │ │ ├── NewsfeedRoute.tsx │ │ │ │ └── useIntersection.tsx │ │ │ ├── PetBestFriendCard.tsx │ │ │ ├── PetByName.tsx │ │ │ ├── PetCheckinListRoute.tsx │ │ │ ├── PetCheckinsCard.tsx │ │ │ ├── PetDetailDeferredRoute.tsx │ │ │ ├── PetDetailRoute.tsx │ │ │ ├── PetMakeFirstCheckinSuperButton.tsx │ │ │ ├── PetPhraseCard.tsx │ │ │ ├── PetStatsCard.tsx │ │ │ ├── PetSummaryCard.tsx │ │ │ ├── PetTaglineCard.tsx │ │ │ ├── PetUpdater.tsx │ │ │ ├── UnreachableFromEntrypoint.tsx │ │ │ ├── __isograph │ │ │ │ ├── AdItem │ │ │ │ │ ├── AdItemDisplay │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ ├── refetch_reader.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ └── AdItemDisplayWrapper │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ ├── BlogItem │ │ │ │ │ ├── BlogItemDisplay │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ └── BlogItemMoreDetail │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ ├── refetch_reader.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ ├── Checkin │ │ │ │ │ ├── CheckinDisplay │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ └── make_super │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ └── refetch_reader.ts │ │ │ │ ├── Image │ │ │ │ │ ├── ImageDisplay │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ ├── refetch_reader.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ └── ImageDisplayWrapper │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ ├── Mutation │ │ │ │ │ └── SetTagline │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ ├── NewsfeedItem │ │ │ │ │ ├── NewsfeedAdOrBlog │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── asAdItem │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ └── asBlogItem │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ ├── Pet │ │ │ │ │ ├── FavoritePhraseLoader │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── FirstCheckinMakeSuperButton │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PetBestFriendCard │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PetCheckinsCard │ │ │ │ │ │ ├── __refetch__0.ts │ │ │ │ │ │ ├── __refetch__query_text__0.ts │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ ├── refetch_reader.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PetCheckinsCardList │ │ │ │ │ │ ├── __refetch__0.ts │ │ │ │ │ │ ├── __refetch__query_text__0.ts │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ ├── refetch_reader.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PetDetailDeferredRouteInnerComponent │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PetPhraseCard │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PetStatsCard │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PetSummaryCard │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PetTaglineCard │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PetUpdater │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── Unreachable2 │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ └── param_type.ts │ │ │ │ │ ├── UnreachableFromEntrypoint │ │ │ │ │ │ └── param_type.ts │ │ │ │ │ ├── __refetch │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ └── refetch_reader.ts │ │ │ │ │ ├── custom_pet_refetch │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ └── refetch_reader.ts │ │ │ │ │ ├── set_best_friend │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ └── refetch_reader.ts │ │ │ │ │ ├── set_best_friend_do_not_use │ │ │ │ │ │ └── output_type.ts │ │ │ │ │ └── set_pet_tagline │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ └── refetch_reader.ts │ │ │ │ ├── PetStats │ │ │ │ │ └── refetch_pet_stats │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ └── refetch_reader.ts │ │ │ │ ├── Query │ │ │ │ │ ├── HomeRoute │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── Newsfeed │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PetByName │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PetCheckinListRoute │ │ │ │ │ │ ├── __refetch__0.ts │ │ │ │ │ │ ├── __refetch__query_text__0.ts │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PetDetailDeferredRoute │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ ├── PetDetailRoute │ │ │ │ │ │ ├── __refetch__0.ts │ │ │ │ │ │ ├── __refetch__1.ts │ │ │ │ │ │ ├── __refetch__2.ts │ │ │ │ │ │ ├── __refetch__3.ts │ │ │ │ │ │ ├── __refetch__4.ts │ │ │ │ │ │ ├── __refetch__5.ts │ │ │ │ │ │ ├── __refetch__query_text__0.ts │ │ │ │ │ │ ├── __refetch__query_text__1.ts │ │ │ │ │ │ ├── __refetch__query_text__2.ts │ │ │ │ │ │ ├── __refetch__query_text__3.ts │ │ │ │ │ │ ├── __refetch__query_text__4.ts │ │ │ │ │ │ ├── __refetch__query_text__5.ts │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ │ └── PetFavoritePhrase │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ ├── Viewer │ │ │ │ │ └── NewsfeedPaginationComponent │ │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ │ ├── output_type.ts │ │ │ │ │ │ ├── param_type.ts │ │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ │ ├── query_text.ts │ │ │ │ │ │ ├── refetch_reader.ts │ │ │ │ │ │ └── resolver_reader.ts │ │ │ │ └── iso.ts │ │ │ └── routes.tsx │ │ └── theme.tsx │ └── tsconfig.json └── vite-demo │ ├── .babelrc.json │ ├── .gitignore │ ├── README.md │ ├── eslint.config.js │ ├── index.html │ ├── isograph.config.json │ ├── package.json │ ├── schema.graphql │ ├── src │ ├── App.tsx │ ├── components │ │ ├── HomePage.tsx │ │ ├── HomePageRoute.tsx │ │ ├── Pokemon.tsx │ │ └── __isograph │ │ │ ├── Pokemon │ │ │ └── Pokemon │ │ │ │ ├── output_type.ts │ │ │ │ ├── param_type.ts │ │ │ │ └── resolver_reader.ts │ │ │ ├── Query │ │ │ └── HomePage │ │ │ │ ├── entrypoint.ts │ │ │ │ ├── normalization_ast.ts │ │ │ │ ├── output_type.ts │ │ │ │ ├── param_type.ts │ │ │ │ ├── query_text.ts │ │ │ │ └── resolver_reader.ts │ │ │ └── iso.ts │ ├── index.css │ ├── main.tsx │ └── vite-env.d.ts │ ├── tsconfig.app.json │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.ts ├── docs-website ├── .gitignore ├── README.md ├── babel.config.js ├── blog │ ├── 2023-06-20-introducing-isograph.md │ ├── 2023-09-20-graphql-conf-posted.md │ ├── 2024-02-15-devex-of-isograph.md │ ├── 2024-02-15-isograph-0.1.0.md │ ├── 2024-02-15-release-notes-0.1.0.md │ ├── 2024-09-11-isograph-0.2.0.md │ ├── 2024-10-23-isograph-deep-dives.md │ ├── 2025-03-03-isograph-0.3.0.md │ └── authors.yml ├── docs │ ├── abstract-types.md │ ├── assets │ │ ├── data-type-short.png │ │ └── data-type.png │ ├── backlog.md │ ├── conditional-fetching.md │ ├── data-driven-dependencies.md │ ├── design-docs │ │ ├── incremental-compilation.md │ │ └── isograph-data-model.md │ ├── development-workflow.md │ ├── expose-field-directives.md │ ├── faq.md │ ├── how-isograph-works │ │ ├── babel-plugin.md │ │ ├── compiler.md │ │ ├── generated-artifacts.md │ │ └── runtime.md │ ├── introduction.md │ ├── isograph-config.md │ ├── isograph-rules.md │ ├── loadable-fields.md │ ├── mutation.md │ ├── pagination.md │ ├── parameters.md │ ├── quickstart.md │ ├── refetching.md │ └── workflow.md ├── docusaurus.config.ts ├── package.json ├── sidebars.ts ├── src │ ├── components │ │ ├── Buttons │ │ │ ├── index.tsx │ │ │ └── styles.module.css │ │ ├── CodeBlock.tsx │ │ ├── Components.tsx │ │ ├── Fetching.tsx │ │ ├── Header │ │ │ ├── index.tsx │ │ │ └── styles.module.css │ │ ├── IntroducingIsograph.tsx │ │ ├── IsIsographRightForMe.tsx │ │ ├── IsographFeatures.tsx │ │ ├── ProblemStatement.tsx │ │ └── YoutubeEmbed.tsx │ ├── css │ │ └── custom.css │ └── pages │ │ ├── discord.tsx │ │ ├── index.tsx │ │ └── tweet.tsx ├── static │ ├── .nojekyll │ ├── fonts │ │ ├── GTEestiDisplay-Bold.woff2 │ │ ├── MaisonNeue-Bold.woff2 │ │ ├── MaisonNeue-Book.woff2 │ │ ├── MaisonNeue-Demi.woff2 │ │ └── MaisonNeue-Medium.woff2 │ └── img │ │ ├── isograph_logo.ico │ │ └── isograph_logo.png └── tsconfig.json ├── gulpfile.js ├── libs ├── isograph-babel-plugin │ ├── BabelPluginIsograph.js │ ├── BabelPluginIsograph.test.js │ ├── README.md │ ├── compileTag.js │ ├── index.js │ ├── package.json │ ├── stub.ts │ └── tsconfig.json ├── isograph-compiler │ ├── README.md │ ├── cli.js │ ├── index.js │ ├── isograph-config-schema.json │ └── package.json ├── isograph-disposable-types │ ├── README.md │ ├── package.json │ ├── src │ │ └── index.ts │ ├── tsconfig.json │ └── tsconfig.pkg.json ├── isograph-react-disposable-state │ ├── README.md │ ├── docs │ │ └── managing-complex-state.md │ ├── package.json │ ├── src │ │ ├── CacheItem.test.ts │ │ ├── CacheItem.ts │ │ ├── ParentCache.test.ts │ │ ├── ParentCache.ts │ │ ├── index.ts │ │ ├── useCachedResponsivePrecommitValue.test.tsx │ │ ├── useCachedResponsivePrecommitValue.ts │ │ ├── useDisposableState.ts │ │ ├── useHasCommittedRef.ts │ │ ├── useLazyDisposableState.test.tsx │ │ ├── useLazyDisposableState.ts │ │ ├── useUpdatableDisposableState.test.tsx │ │ └── useUpdatableDisposableState.ts │ ├── tsconfig.json │ └── tsconfig.pkg.json ├── isograph-react │ ├── README.md │ ├── docs │ │ └── how-useLazyReference-works.md │ ├── isograph.config.json │ ├── package.json │ ├── schema.graphql │ ├── src │ │ ├── core │ │ │ ├── FragmentReference.ts │ │ │ ├── IsographEnvironment.ts │ │ │ ├── PromiseWrapper.ts │ │ │ ├── areEqualWithDeepComparison.ts │ │ │ ├── cache.ts │ │ │ ├── check.ts │ │ │ ├── componentCache.ts │ │ │ ├── entrypoint.ts │ │ │ ├── garbageCollection.ts │ │ │ ├── logging.ts │ │ │ ├── makeNetworkRequest.ts │ │ │ ├── read.ts │ │ │ ├── reader.ts │ │ │ ├── startUpdate.ts │ │ │ └── util.ts │ │ ├── index.ts │ │ ├── loadable-hooks │ │ │ ├── useClientSideDefer.ts │ │ │ ├── useConnectionSpecPagination.ts │ │ │ ├── useImperativeExposedMutationField.ts │ │ │ ├── useImperativeLoadableField.ts │ │ │ └── useSkipLimitPagination.ts │ │ ├── react │ │ │ ├── FragmentReader.tsx │ │ │ ├── IsographEnvironmentProvider.tsx │ │ │ ├── RenderAfterCommit__DO_NOT_USE.tsx │ │ │ ├── useImperativeReference.ts │ │ │ ├── useLazyReference.ts │ │ │ ├── useReadAndSubscribe.ts │ │ │ ├── useRerenderOnChange.ts │ │ │ └── useResult.ts │ │ └── tests │ │ │ ├── __isograph │ │ │ ├── Query │ │ │ │ ├── meName │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ ├── output_type.ts │ │ │ │ │ ├── param_type.ts │ │ │ │ │ ├── query_text.ts │ │ │ │ │ └── resolver_reader.ts │ │ │ │ ├── meNameSuccessor │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ ├── output_type.ts │ │ │ │ │ ├── param_type.ts │ │ │ │ │ ├── query_text.ts │ │ │ │ │ └── resolver_reader.ts │ │ │ │ ├── nodeField │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ ├── output_type.ts │ │ │ │ │ ├── param_type.ts │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ ├── query_text.ts │ │ │ │ │ └── resolver_reader.ts │ │ │ │ └── subquery │ │ │ │ │ ├── entrypoint.ts │ │ │ │ │ ├── normalization_ast.ts │ │ │ │ │ ├── output_type.ts │ │ │ │ │ ├── param_type.ts │ │ │ │ │ ├── parameters_type.ts │ │ │ │ │ ├── query_text.ts │ │ │ │ │ └── resolver_reader.ts │ │ │ └── iso.ts │ │ │ ├── garbageCollection.test.ts │ │ │ ├── meNameSuccessor.ts │ │ │ ├── nodeQuery.ts │ │ │ ├── normalizeData.test.ts │ │ │ └── tsconfig.json │ ├── tsconfig.json │ ├── tsconfig.pkg.json │ └── vitest.config.ts ├── isograph-reference-counted-pointer │ ├── README.md │ ├── package.json │ ├── src │ │ ├── createReferenceCountedPointer.test.ts │ │ ├── createReferenceCountedPointer.ts │ │ └── index.ts │ ├── tsconfig.json │ └── tsconfig.pkg.json └── isograph-swc-plugin │ ├── __test__ │ ├── __snapshots__ │ │ └── wasm.test.ts.snap │ └── wasm.test.ts │ └── package.json ├── package.json ├── pnpm-lock.yaml ├── pnpm-workspace.yaml ├── relay-crates ├── common │ ├── Cargo.toml │ └── src │ │ ├── console_logger.rs │ │ ├── diagnostic.rs │ │ ├── diagnostic_check.rs │ │ ├── feature_flags.rs │ │ ├── lib.rs │ │ ├── location.rs │ │ ├── named_item.rs │ │ ├── perf_logger.rs │ │ ├── pointer_address.rs │ │ ├── rollout.rs │ │ ├── span.rs │ │ ├── sync.rs │ │ └── text_source.rs ├── fixture-tests │ ├── Cargo.toml │ ├── src │ │ ├── lib.rs │ │ ├── main.rs │ │ └── print_diff.rs │ └── tests │ │ ├── uppercase │ │ ├── fixtures │ │ │ ├── hello.expected │ │ │ ├── hello.txt │ │ │ ├── world.expected │ │ │ └── world.txt │ │ └── mod.rs │ │ └── uppercase_test.rs ├── graphql-cli │ ├── Cargo.toml │ ├── examples │ │ ├── print-diagnostic.rs │ │ └── print-source.rs │ └── src │ │ ├── diagnostic_printer.rs │ │ ├── lib.rs │ │ ├── source_printer.rs │ │ └── text_style.rs ├── graphql-syntax │ ├── Cargo.toml │ ├── README.md │ ├── src │ │ ├── lexer.rs │ │ ├── lib.rs │ │ ├── node │ │ │ ├── constant_directive.rs │ │ │ ├── constant_value.rs │ │ │ ├── directive.rs │ │ │ ├── document.rs │ │ │ ├── executable.rs │ │ │ ├── mod.rs │ │ │ ├── primitive.rs │ │ │ ├── type_annotation.rs │ │ │ ├── type_system.rs │ │ │ └── value.rs │ │ ├── parser.rs │ │ ├── source.rs │ │ ├── syntax_error.rs │ │ └── utils.rs │ └── tests │ │ ├── parse_document │ │ ├── fixtures │ │ │ ├── invalid_definition.invalid.expected │ │ │ ├── invalid_definition.invalid.graphql │ │ │ ├── mixed.expected │ │ │ └── mixed.graphql │ │ └── mod.rs │ │ ├── parse_document_test.rs │ │ ├── parse_document_with_features │ │ ├── fixtures │ │ │ ├── fragment_with_empty_vardefs.invalid.expected │ │ │ ├── fragment_with_empty_vardefs.invalid.graphql │ │ │ ├── fragment_with_variable_defs.expected │ │ │ ├── fragment_with_variable_defs.graphql │ │ │ ├── spread_with_arguments.expected │ │ │ ├── spread_with_arguments.graphql │ │ │ ├── spread_with_empty_arguments.invalid.expected │ │ │ └── spread_with_empty_arguments.invalid.graphql │ │ └── mod.rs │ │ ├── parse_document_with_features_test.rs │ │ ├── parse_executable_document │ │ ├── fixtures │ │ │ ├── block_string.expected │ │ │ ├── block_string.graphql │ │ │ ├── fragment_with_variable_defs.invalid.expected │ │ │ ├── fragment_with_variable_defs.invalid.graphql │ │ │ ├── incomplete_field_alias.expected │ │ │ ├── incomplete_field_alias.graphql │ │ │ ├── incorrect_variable_name.invalid.expected │ │ │ ├── incorrect_variable_name.invalid.graphql │ │ │ ├── invalid_number.expected │ │ │ ├── invalid_number.graphql │ │ │ ├── keyword_as_name.expected │ │ │ ├── keyword_as_name.graphql │ │ │ ├── kitchen-sink.expected │ │ │ ├── kitchen-sink.graphql │ │ │ ├── list_of_enum.expected │ │ │ ├── list_of_enum.graphql │ │ │ ├── missing_zero_on_float.invalid.expected │ │ │ ├── missing_zero_on_float.invalid.graphql │ │ │ ├── multiple_parse_errors.invalid.expected │ │ │ ├── multiple_parse_errors.invalid.graphql │ │ │ ├── space_in_variable.expected │ │ │ ├── space_in_variable.graphql │ │ │ ├── spread_with_arguments.invalid.expected │ │ │ ├── spread_with_arguments.invalid.graphql │ │ │ ├── unterminated_string.invalid.expected │ │ │ └── unterminated_string.invalid.graphql │ │ └── mod.rs │ │ ├── parse_executable_document_test.rs │ │ ├── parse_executable_document_with_error_recovery │ │ ├── fixtures │ │ │ ├── argument-missing-identifier-2.expected │ │ │ ├── argument-missing-identifier-2.grahql │ │ │ ├── argument-missing-identifier.expected │ │ │ ├── argument-missing-identifier.graphql │ │ │ ├── argument-missing-value-2.expected │ │ │ ├── argument-missing-value-2.graphql │ │ │ ├── argument-missing-value.expected │ │ │ ├── argument-missing-value.graphql │ │ │ ├── argument-name-only-2.expected │ │ │ ├── argument-name-only-2.graphql │ │ │ ├── argument-name-only.expected │ │ │ ├── argument-name-only.graphql │ │ │ ├── argument-value-only-2.expected │ │ │ ├── argument-value-only-2.graphql │ │ │ ├── argument-value-only-3.expected │ │ │ ├── argument-value-only-3.grahql │ │ │ ├── argument-value-only.expected │ │ │ ├── argument-value-only.graphql │ │ │ ├── argument-without-closing-paren.expected │ │ │ ├── argument-without-closing-paren.graphql │ │ │ ├── directive-without-name.expected │ │ │ ├── directive-without-name.graphql │ │ │ ├── empty-argument-list.expected │ │ │ ├── empty-argument-list.graphql │ │ │ ├── empty-linked-field.expected │ │ │ ├── empty-linked-field.graphql │ │ │ ├── inline-fragment-without-selection.expected │ │ │ ├── inline-fragment-without-selection.graphql │ │ │ ├── type-in-argument-value.expected │ │ │ ├── type-in-argument-value.graphql │ │ │ ├── variable-definition-with-directive.expected │ │ │ └── variable-definition-with-directive.graphql │ │ └── mod.rs │ │ ├── parse_executable_document_with_error_recovery_test.rs │ │ ├── parse_schema_document │ │ ├── fixtures │ │ │ ├── directive_description.expected │ │ │ ├── directive_description.graphql │ │ │ ├── field_description.expected │ │ │ ├── field_description.graphql │ │ │ ├── schema_kitchen_sink.expected │ │ │ ├── schema_kitchen_sink.graphql │ │ │ ├── schema_with_leading_comment.expected │ │ │ ├── schema_with_leading_comment.graphql │ │ │ ├── type_definition.expected │ │ │ └── type_definition.graphql │ │ └── mod.rs │ │ ├── parse_schema_document_test.rs │ │ ├── print │ │ ├── fixtures │ │ │ ├── schema.expected │ │ │ └── schema.graphql │ │ └── mod.rs │ │ └── print_test.rs ├── intern │ ├── Cargo.lock │ ├── Cargo.toml │ └── src │ │ ├── atomic_arena.rs │ │ ├── idhasher.rs │ │ ├── intern.rs │ │ ├── lib.rs │ │ ├── path.rs │ │ ├── sharded_set.rs │ │ ├── small_bytes.rs │ │ ├── string.rs │ │ └── string_key.rs └── signedsource │ ├── Cargo.toml │ └── src │ ├── lib.rs │ └── tests.rs ├── rustfmt.toml ├── scripts ├── check-git-status.sh └── sanity-check.sh ├── tsconfig.build.json ├── tsconfig.json ├── turbo.json ├── vitest.workspace.ts └── vscode-extension ├── .eslintrc.js ├── .gitignore ├── .prettierignore ├── LICENSE.md ├── README.md ├── package-lock.json ├── package.json ├── src ├── config.ts ├── context.ts ├── extension.ts ├── languageClient.ts └── utils │ └── findIsographBinary.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | **/dist/** 2 | **/node_modules/** 3 | .vscode 4 | **/yarn-error.log 5 | **/*.tsbuildinfo 6 | **/*.tgz 7 | **/target/** 8 | **/yarn.lock 9 | **/.env.local 10 | **/.next/** 11 | **/next-env.d.ts 12 | **/*.d.ts 13 | **/.DS_Store 14 | **/.swc/** 15 | 16 | # the built binary is downloaded into this folder during CI 17 | artifacts 18 | 19 | **/out/** 20 | 21 | **/.turbo/** 22 | **/swc_isograph_plugin.wasm 23 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | link-workspace-packages = deep 2 | prefer-workspace-packages = true 3 | enable-pre-post-scripts = true 4 | save-workspace-protocol = false 5 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | fail_fast: true 2 | repos: 3 | - repo: https://github.com/pre-commit/pre-commit-hooks 4 | rev: v4.5.0 5 | hooks: 6 | - id: check-added-large-files 7 | - id: check-merge-conflict 8 | - id: check-symlinks 9 | - id: check-toml 10 | - id: check-xml 11 | - id: check-yaml 12 | - id: destroyed-symlinks 13 | - id: detect-private-key 14 | - id: end-of-file-fixer 15 | - id: mixed-line-ending 16 | - id: trailing-whitespace 17 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | **/__isograph/** 2 | **/build/** 3 | **/target/** 4 | **/pnpm-lock.yaml 5 | **/.docusaurus/** 6 | **/dist/** 7 | **/relay-crates/** 8 | isograph-config-schema.json 9 | **/tests/fixtures/** 10 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "importOrderTypeScriptVersion": "5.6.3", 3 | "overrides": [ 4 | { 5 | "files": ["*.json"], 6 | "options": { 7 | "trailingComma": "none" 8 | } 9 | } 10 | ], 11 | "plugins": ["@ianvs/prettier-plugin-sort-imports"], 12 | "printWidth": 80, 13 | "semi": true, 14 | "singleQuote": true, 15 | "tabWidth": 2, 16 | "trailingComma": "all" 17 | } 18 | -------------------------------------------------------------------------------- /assets/isograph_logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/assets/isograph_logo.ico -------------------------------------------------------------------------------- /assets/isograph_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/assets/isograph_logo.png -------------------------------------------------------------------------------- /crates/common_lang_types/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "common_lang_types" 3 | version = { workspace = true } 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | intern = { path = "../../relay-crates/intern" } 10 | string_key_newtype = { path = "../string_key_newtype" } 11 | serde = { workspace = true } 12 | pathdiff = { workspace = true } 13 | -------------------------------------------------------------------------------- /crates/common_lang_types/src/absolute_and_relative_path.rs: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | 3 | use crate::RelativePathToSourceFile; 4 | 5 | #[derive(Debug, Clone)] 6 | pub struct AbsolutePathAndRelativePath { 7 | pub absolute_path: PathBuf, 8 | pub relative_path: RelativePathToSourceFile, 9 | } 10 | -------------------------------------------------------------------------------- /crates/common_lang_types/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod absolute_and_relative_path; 2 | mod location; 3 | mod path_and_content; 4 | mod selectable_name; 5 | mod span; 6 | mod string_key_types; 7 | mod string_types; 8 | mod text_with_carats; 9 | mod type_and_field; 10 | 11 | pub use absolute_and_relative_path::*; 12 | pub use location::*; 13 | pub use path_and_content::*; 14 | pub use selectable_name::*; 15 | pub use span::*; 16 | pub use string_key_types::*; 17 | pub use string_types::*; 18 | pub use type_and_field::*; 19 | -------------------------------------------------------------------------------- /crates/common_lang_types/src/path_and_content.rs: -------------------------------------------------------------------------------- 1 | use crate::{ArtifactFileName, ObjectTypeAndFieldName}; 2 | 3 | pub struct ArtifactPathAndContent { 4 | pub type_and_field: Option, 5 | pub file_name: ArtifactFileName, 6 | pub file_content: String, 7 | } 8 | -------------------------------------------------------------------------------- /crates/common_lang_types/src/string_types.rs: -------------------------------------------------------------------------------- 1 | #[macro_export] 2 | macro_rules! derive_display { 3 | ($type:ident) => { 4 | impl std::fmt::Display for $type { 5 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 6 | std::fmt::Display::fmt(&self.0, f) 7 | } 8 | } 9 | }; 10 | } 11 | 12 | #[derive(Debug)] 13 | pub struct QueryText(pub String); 14 | derive_display!(QueryText); 15 | -------------------------------------------------------------------------------- /crates/generate_artifacts/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "generate_artifacts" 3 | version = { workspace = true } 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | 7 | [dependencies] 8 | pathdiff = { workspace = true } 9 | lazy_static = { workspace = true } 10 | graphql_lang_types = { path = "../graphql_lang_types" } 11 | isograph_schema = { path = "../isograph_schema" } 12 | isograph_config = { path = "../isograph_config" } 13 | isograph_lang_types = { path = "../isograph_lang_types" } 14 | intern = { path = "../../relay-crates/intern" } 15 | common_lang_types = { path = "../common_lang_types" } 16 | -------------------------------------------------------------------------------- /crates/generate_artifacts/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod eager_reader_artifact; 2 | mod entrypoint_artifact; 3 | mod format_parameter_type; 4 | pub mod generate_artifacts; 5 | mod imperatively_loaded_fields; 6 | mod import_statements; 7 | mod iso_overload_file; 8 | mod normalization_ast_text; 9 | mod reader_ast; 10 | mod refetch_reader_artifact; 11 | 12 | pub use generate_artifacts::get_artifact_path_and_content; 13 | -------------------------------------------------------------------------------- /crates/graphql_lang_types/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "graphql_lang_types" 3 | version = { workspace = true } 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | 7 | [dependencies] 8 | intern = { path = "../../relay-crates/intern" } 9 | common_lang_types = { path = "../common_lang_types" } 10 | strum = { version = "0.25.0", features = ["derive"] } 11 | serde = { workspace = true } 12 | thiserror = { workspace = true } 13 | -------------------------------------------------------------------------------- /crates/graphql_lang_types/README.md: -------------------------------------------------------------------------------- 1 | # `graphql_lang_types` 2 | 3 | Types for when you parse a GraphQL schema or document. 4 | 5 | This is incomplete: currently, it only includes types for part of a GraphQL schema file. Currently, the plan is to support the part of the GraphQL spec used for GraphQL schema files, and not for operations. It shouldn't be hard to support for operations, though. 6 | -------------------------------------------------------------------------------- /crates/graphql_lang_types/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod graphql_directives; 2 | mod graphql_sdl; 3 | mod graphql_type_annotation; 4 | mod value; 5 | mod write; 6 | 7 | pub use graphql_directives::*; 8 | pub use graphql_sdl::*; 9 | pub use graphql_type_annotation::*; 10 | pub use value::*; 11 | pub use write::*; 12 | -------------------------------------------------------------------------------- /crates/graphql_network_protocol/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "graphql_network_protocol" 3 | version = { workspace = true } 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | 7 | [dependencies] 8 | common_lang_types = { path = "../common_lang_types" } 9 | graphql_lang_types = { path = "../graphql_lang_types" } 10 | graphql_schema_parser = { path = "../graphql_schema_parser" } 11 | intern = { path = "../../relay-crates/intern" } 12 | isograph_config = { path = "../isograph_config" } 13 | isograph_lang_types = { path = "../isograph_lang_types" } 14 | isograph_schema = { path = "../isograph_schema" } 15 | pico = { path = "../pico" } 16 | pico_macros = { path = "../pico_macros" } 17 | lazy_static = { workspace = true } 18 | pathdiff = { workspace = true } 19 | thiserror = { workspace = true } 20 | -------------------------------------------------------------------------------- /crates/graphql_network_protocol/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod graphql_network_protocol; 2 | mod process_type_system_definition; 3 | mod query_text; 4 | mod read_schema; 5 | 6 | pub use graphql_network_protocol::*; 7 | use isograph_schema::{ClientScalarSelectable, Schema, ServerObjectEntity}; 8 | pub use read_schema::*; 9 | 10 | pub type ValidatedGraphqlSchema = Schema; 11 | pub type GraphqlSchema = Schema; 12 | pub type UnvalidatedGraphqlSchema = Schema; 13 | 14 | pub type ValidatedGraphqlClientField = ClientScalarSelectable; 15 | 16 | pub type GraphqlSchemaObject = ServerObjectEntity; 17 | -------------------------------------------------------------------------------- /crates/graphql_schema_parser/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "graphql_schema_parser" 3 | version = { workspace = true } 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | 7 | [dependencies] 8 | graphql-syntax = { path = "../../relay-crates/graphql-syntax" } 9 | intern = { path = "../../relay-crates/intern" } 10 | graphql_lang_types = { path = "../graphql_lang_types" } 11 | common_lang_types = { path = "../common_lang_types" } 12 | logos = { workspace = true } 13 | thiserror = { workspace = true } 14 | -------------------------------------------------------------------------------- /crates/graphql_schema_parser/README.md: -------------------------------------------------------------------------------- 1 | # `graphql_schema_parser` 2 | 3 | Parse GraphQL schemas. This does not endeavor to parse GraphQL executable definitions (i.e. fragments, queries, subscriptions or mutations), as these are not needed by Isograph. 4 | -------------------------------------------------------------------------------- /crates/graphql_schema_parser/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod description; 2 | mod parse_schema; 3 | mod peekable_lexer; 4 | pub mod schema_parse_error; 5 | 6 | pub use parse_schema::*; 7 | pub use peekable_lexer::*; 8 | pub use schema_parse_error::*; 9 | -------------------------------------------------------------------------------- /crates/impl_base_types_macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "impl_base_types_macro" 3 | version.workspace = true 4 | edition.workspace = true 5 | license.workspace = true 6 | 7 | [dependencies] 8 | proc-macro2 = { workspace = true } 9 | quote = { workspace = true } 10 | syn = { workspace = true } 11 | 12 | [lib] 13 | proc-macro = true 14 | -------------------------------------------------------------------------------- /crates/isograph_cli/README.md: -------------------------------------------------------------------------------- 1 | # isograph_cli 2 | 3 | This crate ultimately exposes the `isograph` command. 4 | -------------------------------------------------------------------------------- /crates/isograph_compiler/README.md: -------------------------------------------------------------------------------- 1 | # isograph_compiler 2 | -------------------------------------------------------------------------------- /crates/isograph_compiler/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod add_selection_sets; 2 | pub mod batch_compile; 3 | mod compiler_state; 4 | mod create_schema; 5 | mod isograph_literals; 6 | mod source_files; 7 | pub mod watch; 8 | mod with_duration; 9 | mod write_artifacts; 10 | 11 | pub use batch_compile::compile_and_print; 12 | pub use isograph_literals::{ 13 | extract_iso_literals_from_file_content, parse_iso_literals_in_file_content, 14 | IsoLiteralExtraction, 15 | }; 16 | pub use watch::handle_watch_command; 17 | -------------------------------------------------------------------------------- /crates/isograph_compiler/src/with_duration.rs: -------------------------------------------------------------------------------- 1 | use std::time::{Duration, Instant}; 2 | 3 | pub struct WithDuration { 4 | pub elapsed_time: Duration, 5 | pub item: T, 6 | } 7 | 8 | impl WithDuration { 9 | pub fn new(calculate: impl FnOnce() -> T) -> WithDuration { 10 | let start = Instant::now(); 11 | let item = calculate(); 12 | WithDuration { 13 | elapsed_time: start.elapsed(), 14 | item, 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /crates/isograph_config/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "isograph_config" 3 | version = { workspace = true } 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | 7 | [[bin]] 8 | name = "build_json_schema" 9 | path = "src/main.rs" 10 | 11 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 12 | 13 | [dependencies] 14 | common_lang_types = { path = "../common_lang_types" } 15 | intern = { path = "../../relay-crates/intern" } 16 | schemars = { workspace = true } 17 | serde = { workspace = true } 18 | serde_json = { workspace = true } 19 | colorize = { workspace = true } 20 | tracing = { workspace = true } 21 | -------------------------------------------------------------------------------- /crates/isograph_config/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod compilation_options; 2 | 3 | pub use compilation_options::*; 4 | -------------------------------------------------------------------------------- /crates/isograph_config/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::fs; 2 | 3 | use isograph_config::IsographProjectConfig; 4 | use schemars::schema_for; 5 | 6 | fn main() { 7 | let schema = schema_for!(IsographProjectConfig); 8 | 9 | fs::write( 10 | "./libs/isograph-compiler/isograph-config-schema.json", 11 | serde_json::to_string_pretty(&schema).unwrap(), 12 | ) 13 | .unwrap(); 14 | } 15 | -------------------------------------------------------------------------------- /crates/isograph_fixture_tests/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "isograph_fixture_tests" 3 | version = { workspace = true } 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | 7 | [[bin]] 8 | name = "generate_isograph_fixtures" 9 | path = "src/main.rs" 10 | 11 | [dependencies] 12 | clap = { workspace = true } 13 | regex = { workspace = true } 14 | lazy_static = { workspace = true } 15 | intern = { path = "../../relay-crates/intern" } 16 | isograph_compiler = { path = "../isograph_compiler" } 17 | isograph_config = { path = "../isograph_config" } 18 | common_lang_types = { path = "../common_lang_types" } 19 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "isograph_lang_parser" 3 | version = { workspace = true } 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | 7 | [dependencies] 8 | common_lang_types = { path = "../common_lang_types" } 9 | isograph_lang_types = { path = "../isograph_lang_types" } 10 | intern = { path = "../../relay-crates/intern" } 11 | graphql_lang_types = { path = "../graphql_lang_types" } 12 | logos = { workspace = true } 13 | thiserror = { workspace = true } 14 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/README.md: -------------------------------------------------------------------------------- 1 | # `isograph_lang_parser` 2 | 3 | ## Overview of the language 4 | 5 | The Isograph query language: 6 | 7 | - compiles to fragment-less GraphQL queries, 8 | - has support for fragment composition, and 9 | - associates fragments with JavaScript. 10 | 11 | In that sense, it is like Relay, if: 12 | 13 | - everything was a resolver, and 14 | - the language for writing queries/fragments differed from GraphQL. 15 | 16 | ## Examples 17 | 18 | TODO fill me in 19 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/commented-out.input.js: -------------------------------------------------------------------------------- 1 | // export const myField = iso(` 2 | // field User.bestFriend on User { 3 | // friends { 4 | // id 5 | // closeness 6 | // } 7 | // } 8 | // `)(); 9 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/commented-out.output: -------------------------------------------------------------------------------- 1 | Ok( 2 | [], 3 | ) -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/entrypoint-basic.input.js: -------------------------------------------------------------------------------- 1 | iso(`entrypoint Type.Name`); 2 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/entrypoint-with-directives.input.js: -------------------------------------------------------------------------------- 1 | iso(`entrypoint Type.Name @foo`); 2 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/entrypoint-with-selection-set.input.js: -------------------------------------------------------------------------------- 1 | iso(`entrypoint Type.Name { 2 | wat 3 | }`); 4 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-args-array.input.js: -------------------------------------------------------------------------------- 1 | export const ValidArgs = iso(` 2 | field Type.Name { 3 | args(arg1: []) 4 | } 5 | `)(); 6 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-args-boolean.input.js: -------------------------------------------------------------------------------- 1 | export const ValidArgs = iso(` 2 | field Type.Name { 3 | args(arg1: true) 4 | } 5 | `)(); 6 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-args-enum.input.js: -------------------------------------------------------------------------------- 1 | export const ValidArgs = iso(` 2 | field Type.Name { 3 | args(arg1: ENUM) 4 | } 5 | `)(); 6 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-args-null.input.js: -------------------------------------------------------------------------------- 1 | export const ValidArgs = iso(` 2 | field Type.Name { 3 | args(arg1: null) 4 | } 5 | `)(); 6 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-args-number.input.js: -------------------------------------------------------------------------------- 1 | export const ValidArgs = iso(` 2 | field Type.Name { 3 | args(arg1: 123) 4 | } 5 | `)(); 6 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-args-obj.input.js: -------------------------------------------------------------------------------- 1 | export const ValidArgs = iso(` 2 | field Type.Name { 3 | args(arg1: { foo: "bar" }) 4 | } 5 | `)(); 6 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-args-string.input.js: -------------------------------------------------------------------------------- 1 | export const ValidArgs = iso(` 2 | field Type.Name { 3 | args(arg1: "string literal") 4 | } 5 | `)(); 6 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-args-variable.input.js: -------------------------------------------------------------------------------- 1 | export const ValidArgs = iso(` 2 | field Type.Name { 3 | args(arg1: $var) 4 | } 5 | `)(); 6 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-directives-after-open-curly.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type.Name { 3 | linked { 4 | @wat 5 | } 6 | } 7 | `)(); 8 | 9 | export const BasicField2 = iso(` 10 | field Type.Name { 11 | @wat 12 | } 13 | `)(); 14 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-directives-on-definition-invalid.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type.Name @hello @there { 3 | } 4 | `)(); 5 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-directives-on-definition-valid.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type.Name @component { 3 | } 4 | `)(); 5 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-directives-on-linked-invalid.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type.Name { 3 | linked @hello @there { 4 | } 5 | } 6 | `)(); 7 | 8 | export const BasicField2 = iso(` 9 | field Type.Name { 10 | linked @loadable(asdf: true) { 11 | } 12 | } 13 | `)(); 14 | 15 | export const BasicField3 = iso(` 16 | field Type.Name { 17 | linked @loadable @updatable { 18 | } 19 | } 20 | `)(); 21 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-directives-on-linked-valid.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type.Name { 3 | linked @loadable { 4 | } 5 | } 6 | `)(); 7 | 8 | export const updatable = iso(` 9 | field Type.Name { 10 | linked @updatable { 11 | } 12 | } 13 | `)(); 14 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-directives-on-scalar-invalid.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type.Name { 3 | scalar @hello @there 4 | } 5 | `)(); 6 | 7 | export const BasicField2 = iso(` 8 | field Type.Name { 9 | linked @loadable(asdf: true) { 10 | } 11 | } 12 | `)(); 13 | 14 | export const BasicField3 = iso(` 15 | field Type.Name { 16 | linked @loadable @updatable { 17 | } 18 | } 19 | `)(); 20 | 21 | export const BasicField4 = iso(` 22 | field Type.Name { 23 | linked @loadable(lazyLoadArtifact: 123) { 24 | } 25 | } 26 | `)(); 27 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-directives-on-scalar-valid.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type.Name { 3 | scalar @loadable 4 | } 5 | `)(); 6 | 7 | export const BasicField2 = iso(` 8 | field Type.Name { 9 | scalar @loadable(lazyLoadArtifact: false) 10 | } 11 | `)(); 12 | 13 | export const BasicField3 = iso(` 14 | field Type.Name { 15 | scalar @loadable(lazyLoadArtifact: true) 16 | } 17 | `)(); 18 | 19 | export const updatable = iso(` 20 | field Type.Name { 21 | scalar @updatable 22 | } 23 | `)(); 24 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-empty-linked-field-selection-set.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type.Name { 3 | linked {} 4 | } 5 | `)(); 6 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-empty-selection-set.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type.Name {} 3 | `)(); 4 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-grabbag-field-set.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type.Name 3 | { 4 | scalar 5 | linked { 6 | scalarWithComma, 7 | } 8 | linkedWithComma { 9 | blah 10 | }, 11 | multiple, on, the, same, line 12 | including, youCanEndWithALinkedField { 13 | butWhyWouldYouDoThat 14 | } 15 | } 16 | `)(); 17 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-multi-line-description.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type.Name 3 | """ 4 | Look, a multi-line description. 5 | 6 | Very cool. 7 | """ 8 | {} 9 | `)(); 10 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-no-field-name.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type. { 3 | } 4 | `)(); 5 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-no-parens.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type.Name { 3 | } 4 | `); 5 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-no-type-name.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field .Name { 3 | } 4 | `)(); 5 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-single-line-description.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type.Name 3 | "It's a bit weird to have a single line description, I think, but it's allowed" 4 | {} 5 | `)(); 6 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/field-unclosed.input.js: -------------------------------------------------------------------------------- 1 | export const BasicField = iso(` 2 | field Type.Name { 3 | `)(); 4 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/pointer-basic.input.js: -------------------------------------------------------------------------------- 1 | export const pointer = iso(` 2 | pointer User.bestFriend to User { 3 | friends { 4 | id 5 | closeness 6 | } 7 | } 8 | `)(); 9 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/fixtures/pointer-directives.input.js: -------------------------------------------------------------------------------- 1 | // Directives are disallowed when we process the pointer, but allowed at parse time 2 | export const pointer = iso(` 3 | pointer User.bestFriend to User @directives @allowed @at @parse @time { 4 | friends { 5 | id 6 | closeness 7 | } 8 | } 9 | `)(); 10 | -------------------------------------------------------------------------------- /crates/isograph_lang_parser/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod description; 2 | mod isograph_literal_parse_error; 3 | mod parse_iso_literal; 4 | mod peekable_lexer; 5 | mod token_kind; 6 | 7 | pub(crate) use description::*; 8 | pub use isograph_literal_parse_error::*; 9 | pub use parse_iso_literal::*; 10 | pub use peekable_lexer::*; 11 | pub use token_kind::*; 12 | -------------------------------------------------------------------------------- /crates/isograph_lang_types/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "isograph_lang_types" 3 | version = { workspace = true } 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | 7 | [dependencies] 8 | common_lang_types = { path = "../common_lang_types" } 9 | graphql_lang_types = { path = "../graphql_lang_types" } 10 | intern = { path = "../../relay-crates/intern" } 11 | pico = { path = "../pico" } 12 | pico_macros = { path = "../pico_macros" } 13 | u32_newtypes = { path = "../u32_newtypes" } 14 | serde = { workspace = true } 15 | thiserror = { workspace = true } 16 | -------------------------------------------------------------------------------- /crates/isograph_lang_types/README.md: -------------------------------------------------------------------------------- 1 | # `isograph_lang_types` 2 | 3 | Types related to parsed Isograph literals 4 | -------------------------------------------------------------------------------- /crates/isograph_lang_types/src/client_field_directive_set.rs: -------------------------------------------------------------------------------- 1 | use serde::Deserialize; 2 | 3 | use crate::EmptyDirectiveSet; 4 | 5 | #[derive(Deserialize, Debug, Clone, PartialEq, PartialOrd, Ord, Eq, Copy, Hash)] 6 | #[serde(rename_all = "camelCase", untagged)] 7 | pub enum ClientFieldDirectiveSet { 8 | Component(ComponentDirectiveSet), 9 | None(EmptyDirectiveSet), 10 | } 11 | 12 | #[derive(Deserialize, Debug, Default, Clone, PartialEq, PartialOrd, Ord, Eq, Copy, Hash)] 13 | #[serde(deny_unknown_fields, rename_all = "camelCase")] 14 | pub struct ComponentDirectiveSet { 15 | pub component: ComponentDirectiveParameters, 16 | } 17 | #[derive(Deserialize, Debug, Default, Clone, Copy, PartialEq, PartialOrd, Ord, Eq, Hash)] 18 | #[serde(deny_unknown_fields, rename_all = "camelCase")] 19 | pub struct ComponentDirectiveParameters {} 20 | -------------------------------------------------------------------------------- /crates/isograph_lang_types/src/entrypoint_directive_set.rs: -------------------------------------------------------------------------------- 1 | use serde::Deserialize; 2 | 3 | use crate::EmptyDirectiveSet; 4 | 5 | #[derive(Deserialize, Debug, Clone, PartialEq, PartialOrd, Ord, Eq, Copy, Hash)] 6 | #[serde(rename_all = "camelCase", untagged)] 7 | pub enum EntrypointDirectiveSet { 8 | LazyLoad(LazyLoadDirectiveSet), 9 | None(EmptyDirectiveSet), 10 | } 11 | 12 | #[derive(Deserialize, Debug, Default, Clone, PartialEq, PartialOrd, Ord, Eq, Copy, Hash)] 13 | #[serde(deny_unknown_fields, rename_all = "camelCase")] 14 | pub struct LazyLoadDirectiveSet { 15 | pub lazy_load: LazyLoadDirectiveParameters, 16 | } 17 | 18 | #[derive(Deserialize, Debug, Default, Clone, Copy, PartialEq, PartialOrd, Ord, Eq, Hash)] 19 | #[serde(deny_unknown_fields, rename_all = "camelCase")] 20 | pub struct LazyLoadDirectiveParameters {} 21 | -------------------------------------------------------------------------------- /crates/isograph_lang_types/src/id_types.rs: -------------------------------------------------------------------------------- 1 | use u32_newtypes::{u32_conversion, u32_newtype}; 2 | 3 | use crate::SelectionType; 4 | 5 | // Any field defined on the server 6 | u32_newtype!(ServerScalarSelectableId); 7 | u32_newtype!(ServerObjectSelectableId); 8 | // A field that acts as an id 9 | u32_newtype!(ServerStrongIdFieldId); 10 | 11 | u32_conversion!(from: ServerStrongIdFieldId, to: ServerScalarSelectableId); 12 | 13 | u32_newtype!(ClientScalarSelectableId); 14 | 15 | u32_newtype!(ClientObjectSelectableId); 16 | 17 | u32_newtype!(ServerObjectEntityId); 18 | 19 | u32_newtype!(ServerScalarEntityId); 20 | 21 | pub type ServerEntityId = SelectionType; 22 | 23 | u32_newtype!(RefetchQueryIndex); 24 | -------------------------------------------------------------------------------- /crates/isograph_lang_types/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod base_types; 2 | mod client_field_declaration; 3 | mod client_field_directive_set; 4 | mod entrypoint_declaration; 5 | mod entrypoint_directive_set; 6 | mod id_types; 7 | mod isograph_directives; 8 | mod isograph_type_annotation; 9 | mod selection_directive_set; 10 | mod source_types; 11 | mod with_id; 12 | mod with_target_entity_id; 13 | 14 | pub use base_types::*; 15 | pub use client_field_declaration::*; 16 | pub use client_field_directive_set::*; 17 | pub use entrypoint_declaration::*; 18 | pub use entrypoint_directive_set::EntrypointDirectiveSet; 19 | pub use id_types::*; 20 | pub use isograph_directives::*; 21 | pub use isograph_type_annotation::*; 22 | pub use selection_directive_set::*; 23 | pub use source_types::*; 24 | pub use with_id::*; 25 | pub use with_target_entity_id::*; 26 | -------------------------------------------------------------------------------- /crates/isograph_lang_types/src/source_types.rs: -------------------------------------------------------------------------------- 1 | use common_lang_types::{RelativePathToSourceFile, TextSource}; 2 | use pico_macros::Source; 3 | 4 | #[derive(Debug, Clone, PartialEq, Eq, Source)] 5 | pub struct SchemaSource { 6 | #[key] 7 | pub relative_path: RelativePathToSourceFile, 8 | pub content: String, 9 | pub text_source: TextSource, 10 | } 11 | 12 | #[derive(Debug, Clone, PartialEq, Eq, Source)] 13 | pub struct IsoLiteralsSource { 14 | #[key] 15 | pub relative_path: RelativePathToSourceFile, 16 | pub content: String, 17 | } 18 | -------------------------------------------------------------------------------- /crates/isograph_lsp/src/lib.rs: -------------------------------------------------------------------------------- 1 | use isograph_config::CompilerConfig; 2 | use lsp_process_error::LSPProcessResult; 3 | use lsp_server::Connection; 4 | 5 | pub mod lsp_notification_dispatch; 6 | pub mod lsp_process_error; 7 | mod lsp_request_dispatch; 8 | pub mod lsp_runtime_error; 9 | mod lsp_state; 10 | mod row_col_offset; 11 | mod semantic_tokens; 12 | pub mod server; 13 | pub mod text_document; 14 | 15 | pub async fn start_language_server(config: CompilerConfig) -> LSPProcessResult<()> { 16 | let (connection, io_handles) = Connection::stdio(); 17 | let params = server::initialize(&connection)?; 18 | server::run(connection, config, params).await?; 19 | io_handles.join()?; 20 | Ok(()) 21 | } 22 | -------------------------------------------------------------------------------- /crates/isograph_lsp/src/lsp_runtime_error.rs: -------------------------------------------------------------------------------- 1 | use lsp_server::ErrorCode; 2 | use lsp_server::ResponseError; 3 | 4 | pub type LSPRuntimeResult = std::result::Result; 5 | 6 | #[derive(Debug, Clone)] 7 | pub enum LSPRuntimeError { 8 | ExpectedError, 9 | UnexpectedError(String), 10 | } 11 | 12 | impl From for Option { 13 | fn from(err: LSPRuntimeError) -> Self { 14 | match err { 15 | LSPRuntimeError::ExpectedError => None, 16 | LSPRuntimeError::UnexpectedError(message) => Some(ResponseError { 17 | code: ErrorCode::UnknownErrorCode as i32, 18 | message, 19 | data: None, 20 | }), 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /crates/isograph_schema/README.md: -------------------------------------------------------------------------------- 1 | # `isograph_schema` 2 | 3 | Created from the results of the `graphql_schema_parser` (which parses the server GraphQL schema). 4 | -------------------------------------------------------------------------------- /crates/isograph_schema/src/create_additional_fields/mod.rs: -------------------------------------------------------------------------------- 1 | pub(crate) mod add_link_fields; 2 | mod argument_map; 3 | mod create_additional_fields_error; 4 | pub(crate) mod expose_field_directive; 5 | 6 | pub use create_additional_fields_error::*; 7 | pub use expose_field_directive::*; 8 | -------------------------------------------------------------------------------- /crates/isograph_schema/src/data_model/mod.rs: -------------------------------------------------------------------------------- 1 | mod client_selectables; 2 | mod entities; 3 | mod server_selectables; 4 | mod traits; 5 | 6 | pub use client_selectables::*; 7 | pub use entities::*; 8 | pub use server_selectables::*; 9 | pub use traits::*; 10 | -------------------------------------------------------------------------------- /crates/isograph_schema/src/data_model/traits/mod.rs: -------------------------------------------------------------------------------- 1 | mod client_or_server_object_selectable; 2 | mod client_scalar_or_object_selectable; 3 | mod scalar_or_object_entity; 4 | mod server_scalar_or_object_selectable; 5 | 6 | pub use client_or_server_object_selectable::*; 7 | pub use client_scalar_or_object_selectable::*; 8 | pub use scalar_or_object_entity::*; 9 | pub use server_scalar_or_object_selectable::*; 10 | -------------------------------------------------------------------------------- /crates/pico/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pico" 3 | version.workspace = true 4 | edition.workspace = true 5 | license.workspace = true 6 | 7 | [dependencies] 8 | intern = { path = "../../relay-crates/intern" } 9 | pico_macros = { path = "../pico_macros" } 10 | u64_newtypes = { path = "../u64_newtypes" } 11 | boxcar = { workspace = true } 12 | dashmap = { workspace = true } 13 | lru = { workspace = true } 14 | once_map = { workspace = true } 15 | serde = { workspace = true } 16 | serde_derive = { workspace = true } 17 | thiserror = { workspace = true } 18 | tinyvec = { workspace = true, features = ["serde"] } 19 | tracing = { workspace = true } 20 | -------------------------------------------------------------------------------- /crates/pico/src/index.rs: -------------------------------------------------------------------------------- 1 | use std::{any::type_name, fmt, marker::PhantomData}; 2 | 3 | #[derive(Clone, Copy)] 4 | pub struct Index { 5 | pub idx: usize, 6 | phantom: PhantomData, 7 | } 8 | 9 | impl Index { 10 | pub fn new(idx: usize) -> Self { 11 | Self { 12 | idx, 13 | phantom: PhantomData, 14 | } 15 | } 16 | } 17 | 18 | impl fmt::Debug for Index { 19 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 20 | write!(f, "Index<{}>[{:?}]", type_name::(), self.idx) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /crates/pico/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod database; 2 | mod dependency; 3 | mod derived_node; 4 | mod dyn_eq; 5 | mod epoch; 6 | mod execute_memoized_function; 7 | mod garbage_collection; 8 | mod index; 9 | mod intern; 10 | pub mod macro_fns; 11 | mod memo_ref; 12 | mod retained_query; 13 | mod source; 14 | 15 | pub use database::*; 16 | pub use derived_node::*; 17 | pub use execute_memoized_function::*; 18 | pub use intern::*; 19 | pub use memo_ref::*; 20 | pub use source::*; 21 | -------------------------------------------------------------------------------- /crates/pico/tests/tests.rs: -------------------------------------------------------------------------------- 1 | mod garbage_collection { 2 | mod basic_gc; 3 | mod inner_retained; 4 | mod multiple_calls; 5 | mod outer_retained; 6 | mod retained; 7 | mod retained_and_in_lru; 8 | } 9 | 10 | mod params { 11 | mod memo_ref_never_cloned; 12 | mod other_param_cloned_on_execute; 13 | mod source_id_never_cloned; 14 | } 15 | -------------------------------------------------------------------------------- /crates/pico_macros/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pico_macros" 3 | version.workspace = true 4 | edition.workspace = true 5 | license.workspace = true 6 | 7 | [dependencies] 8 | proc-macro2 = { workspace = true } 9 | quote = { workspace = true } 10 | syn = { workspace = true } 11 | 12 | [lib] 13 | proc-macro = true 14 | -------------------------------------------------------------------------------- /crates/pico_macros/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod memo_macro; 2 | mod singleton; 3 | mod source; 4 | 5 | extern crate proc_macro2; 6 | 7 | use proc_macro::TokenStream; 8 | 9 | #[proc_macro_attribute] 10 | pub fn memo(args: TokenStream, input: TokenStream) -> TokenStream { 11 | memo_macro::memo(args, input) 12 | } 13 | 14 | #[proc_macro_derive(Source, attributes(key))] 15 | pub fn source(input: TokenStream) -> TokenStream { 16 | source::source(input) 17 | } 18 | 19 | #[proc_macro_derive(Singleton)] 20 | pub fn singleton(input: TokenStream) -> TokenStream { 21 | singleton::singleton(input) 22 | } 23 | -------------------------------------------------------------------------------- /crates/pico_macros/src/singleton.rs: -------------------------------------------------------------------------------- 1 | use proc_macro::TokenStream; 2 | use quote::quote; 3 | use syn::{parse_macro_input, DeriveInput}; 4 | 5 | pub(crate) fn singleton(item: TokenStream) -> TokenStream { 6 | let input = parse_macro_input!(item as DeriveInput); 7 | let struct_name = input.ident.clone(); 8 | 9 | let output = quote! { 10 | impl ::pico::Source for #struct_name { 11 | fn get_key(&self) -> ::pico::Key { 12 | use ::std::hash::{Hash, Hasher, DefaultHasher}; 13 | let mut s = DefaultHasher::new(); 14 | ::core::any::TypeId::of::<#struct_name>().hash(&mut s); 15 | s.finish().into() 16 | } 17 | } 18 | }; 19 | 20 | output.into() 21 | } 22 | -------------------------------------------------------------------------------- /crates/string_key_newtype/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "string_key_newtype" 3 | version = { workspace = true } 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | 7 | [dependencies] 8 | intern = { path = "../../relay-crates/intern" } 9 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/README.md: -------------------------------------------------------------------------------- 1 | # SWC Isograph plugin 2 | 3 | If you follow the instructions in `development-workflow.md`, then the plugin will be built when you run `pnpm dev` in `demos/pet-demo`. 4 | 5 | ## Fold vs VisitMut 6 | 7 | (This page)[https://rustdoc.swc.rs/swc_visit/index.html] provides the relevant documentation about when to use Fold vs VisitMut 8 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/base/should_return_an_identity_for_non_called_iso_function/input.js: -------------------------------------------------------------------------------- 1 | export const HomeRoute = iso(` 2 | field Query.HomeRoute @component { 3 | pets { 4 | id 5 | } 6 | } 7 | `); 8 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/base/should_return_an_identity_for_non_called_iso_function/isograph.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../../../../../../libs/isograph-compiler/isograph-config-schema.json", 3 | "project_root": "./src/components", 4 | "schema": "./backend/schema.graphql", 5 | "schema_extensions": ["./backend/schema-extension.graphql"], 6 | "options": { "module": "esmodule" } 7 | } 8 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/base/should_return_an_identity_for_non_called_iso_function/output.js: -------------------------------------------------------------------------------- 1 | export const HomeRoute = (x) => x; 2 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/base/should_transform_iso_fn_to_a_import_call/input.js: -------------------------------------------------------------------------------- 1 | function test() { 2 | const a = iso(`entrypoint Query.HomeRoute`); 3 | } 4 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/base/should_transform_iso_fn_to_a_import_call/isograph.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../../../../../../libs/isograph-compiler/isograph-config-schema.json", 3 | "project_root": "./src/components", 4 | "schema": "./backend/schema.graphql", 5 | "schema_extensions": ["./backend/schema-extension.graphql"], 6 | "options": { "module": "esmodule" } 7 | } 8 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/base/should_transform_iso_fn_to_a_import_call/output.js: -------------------------------------------------------------------------------- 1 | import _Query__HomeRoute from "./__isograph/Query/HomeRoute/entrypoint.ts"; 2 | 3 | function test() { 4 | const a = _Query__HomeRoute; 5 | } 6 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/base/should_transform_iso_fn_to_a_require_call/input.js: -------------------------------------------------------------------------------- 1 | const { fragmentReference } = useLazyReference( 2 | iso(`entrypoint Query.HomeRoute`), 3 | {}, 4 | ); 5 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/base/should_transform_iso_fn_to_a_require_call/isograph.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../../../../../../libs/isograph-compiler/isograph-config-schema.json", 3 | "project_root": "./src/components", 4 | "schema": "./backend/schema.graphql", 5 | "schema_extensions": ["./backend/schema-extension.graphql"], 6 | "options": { 7 | "module": "commonjs" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/base/should_transform_iso_fn_to_a_require_call/output.js: -------------------------------------------------------------------------------- 1 | const { fragmentReference } = useLazyReference(require("./__isograph/Query/HomeRoute/entrypoint.ts").default, {}); -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/base/should_transform_nested_calls_to_iso/input.js: -------------------------------------------------------------------------------- 1 | export const HomeRoute = iso(` 2 | field Query.HomeRoute @component { 3 | pets { 4 | id 5 | PetSummaryCard 6 | } 7 | } 8 | `)(function HomeRouteComponent({ data }) { 9 | const { fragmentReference, loadFragmentReference } = useImperativeReference( 10 | iso(`entrypoint Query.PetFavoritePhrase`), 11 | ); 12 | 13 | return "Render"; 14 | }); 15 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/base/should_transform_nested_calls_to_iso/isograph.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../../../../../../libs/isograph-compiler/isograph-config-schema.json", 3 | "project_root": "./src/components", 4 | "schema": "./backend/schema.graphql", 5 | "schema_extensions": ["./backend/schema-extension.graphql"], 6 | "options": { "module": "commonjs" } 7 | } 8 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/base/should_transform_nested_calls_to_iso/output.js: -------------------------------------------------------------------------------- 1 | export const HomeRoute = function HomeRouteComponent({ data }) { 2 | const { fragmentReference, loadFragmentReference } = useImperativeReference(require("./__isograph/Query/PetFavoritePhrase/entrypoint.ts").default); 3 | return "Render"; 4 | }; 5 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/errors/invalid_iso_keyword/input.js: -------------------------------------------------------------------------------- 1 | export const HomeRoute = iso(` 2 | unknown Query.HomeRoute @component { 3 | pets { 4 | id 5 | PetSummaryCard 6 | } 7 | } 8 | `)(function Test() { 9 | return 'Render'; 10 | }); 11 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/errors/invalid_iso_keyword/isograph.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../../../../../../libs/isograph-compiler/isograph-config-schema.json", 3 | "project_root": "./src/components", 4 | "schema": "./backend/schema.graphql", 5 | "schema_extensions": ["./backend/schema-extension.graphql"], 6 | "options": { "module": "commonjs" } 7 | } 8 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/errors/invalid_iso_keyword/output.js: -------------------------------------------------------------------------------- 1 | export const HomeRoute = iso(` 2 | unknown Query.HomeRoute @component { 3 | pets { 4 | id 5 | PetSummaryCard 6 | } 7 | } 8 | `)(function Test() { 9 | return 'Render'; 10 | }); 11 | 12 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/errors/invalid_iso_keyword/output.stderr: -------------------------------------------------------------------------------- 1 | 2 | x Invalid iso tag usage. Expected 'entrypoint' or 'field'. 3 | ,-[input.js:1:1] 4 | 1 | ,-> export const HomeRoute = iso(` 5 | 2 | | unknown Query.HomeRoute @component { 6 | 3 | | pets { 7 | 4 | | id 8 | 5 | | PetSummaryCard 9 | 6 | | } 10 | 7 | | } 11 | 8 | `-> `)(function Test() { 12 | 9 | return 'Render'; 13 | `---- 14 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/errors/one_arg_only_for_iso_function/input.js: -------------------------------------------------------------------------------- 1 | export const HomeRoute = iso(` 2 | field Query.HomeRoute @component { 3 | pets { 4 | id 5 | PetSummaryCard 6 | } 7 | } 8 | `)(); 9 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/errors/one_arg_only_for_iso_function/isograph.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../../../../../../libs/isograph-compiler/isograph-config-schema.json", 3 | "project_root": "./src/components", 4 | "schema": "./backend/schema.graphql", 5 | "schema_extensions": ["./backend/schema-extension.graphql"], 6 | "options": { "module": "commonjs" } 7 | } 8 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/errors/one_arg_only_for_iso_function/output.js: -------------------------------------------------------------------------------- 1 | export const HomeRoute = iso(` 2 | field Query.HomeRoute @component { 3 | pets { 4 | id 5 | PetSummaryCard 6 | } 7 | } 8 | `)(); 9 | 10 | -------------------------------------------------------------------------------- /crates/swc_isograph_plugin/tests/fixtures/errors/one_arg_only_for_iso_function/output.stderr: -------------------------------------------------------------------------------- 1 | 2 | x Invalid iso tag usage. The iso function should be passed exactly one argument. 3 | ,-[input.js:1:1] 4 | 1 | ,-> export const HomeRoute = iso(` 5 | 2 | | field Query.HomeRoute @component { 6 | 3 | | pets { 7 | 4 | | id 8 | 5 | | PetSummaryCard 9 | 6 | | } 10 | 7 | | } 11 | 8 | `-> `)(); 12 | `---- 13 | -------------------------------------------------------------------------------- /crates/tests/src/lib.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /crates/tests/tests/fixtures/directives/mutation_extension_extra_nestedfield.graphql: -------------------------------------------------------------------------------- 1 | extend type Mutation 2 | @exposeField( 3 | field: "set_pet_tagline.pet" 4 | fieldMap: [{ from: "id", day: "monday", to: "input.id" }] 5 | ) 6 | @exposeField( 7 | field: "set_pet_best_friend.pet" 8 | fieldMap: [{ from: "id", to: "id" }] 9 | ) 10 | -------------------------------------------------------------------------------- /crates/tests/tests/fixtures/directives/mutation_extension_extra_toplevelfield.graphql: -------------------------------------------------------------------------------- 1 | extend type Mutation 2 | @exposeField( 3 | field: "set_pet_tagline.pet" 4 | weight: 7 5 | fieldMap: [{ from: "id", to: "input.id" }] 6 | ) 7 | @exposeField( 8 | field: "set_pet_best_friend.pet" 9 | fieldMap: [{ from: "id", to: "id" }] 10 | ) 11 | -------------------------------------------------------------------------------- /crates/tests/tests/fixtures/directives/mutation_extension_missing_nestedfield.graphql: -------------------------------------------------------------------------------- 1 | extend type Mutation 2 | @exposeField(fieldMap: [{ to: "input.id" }], field: "set_pet_tagline.pet") 3 | -------------------------------------------------------------------------------- /crates/tests/tests/fixtures/directives/mutation_extension_missing_toplevelfield.graphql: -------------------------------------------------------------------------------- 1 | extend type Mutation @exposeField(fieldMap: [{ from: "id", to: "input.id" }]) 2 | -------------------------------------------------------------------------------- /crates/tests/tests/fixtures/directives/mutation_extension_valid.graphql: -------------------------------------------------------------------------------- 1 | extend type Mutation 2 | @exposeField( 3 | field: "set_pet_tagline.pet" 4 | fieldMap: [{ from: "id", to: "input.id" }] 5 | ) 6 | @exposeField( 7 | field: "set_pet_best_friend.pet" 8 | fieldMap: [{ from: "id", to: "id" }] 9 | ) 10 | -------------------------------------------------------------------------------- /crates/tests/tests/fixtures/directives/mutation_extension_valid_as.graphql: -------------------------------------------------------------------------------- 1 | extend type Mutation 2 | @exposeField( 3 | as: "set_puppy_tagline" 4 | field: "set_pet_tagline.pet" 5 | fieldMap: [{ from: "id", to: "input.id" }] 6 | ) 7 | @exposeField( 8 | field: "set_pet_best_friend.pet" 9 | fieldMap: [{ from: "id", to: "id" }] 10 | ) 11 | -------------------------------------------------------------------------------- /crates/u32_newtypes/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "u32_newtypes" 3 | version = { workspace = true } 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /crates/u64_newtypes/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "u64_newtypes" 3 | version = { workspace = true } 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /demos/disposable-state-ajax-demo/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /demos/disposable-state-ajax-demo/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | 27 | # local env files 28 | .env*.local 29 | 30 | # vercel 31 | .vercel 32 | 33 | # typescript 34 | *.tsbuildinfo 35 | next-env.d.ts 36 | 37 | .vscode 38 | 39 | node_modules 40 | .next 41 | -------------------------------------------------------------------------------- /demos/disposable-state-ajax-demo/next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = {}; 3 | 4 | module.exports = nextConfig; 5 | -------------------------------------------------------------------------------- /demos/disposable-state-ajax-demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "disposable-state-ajax-demo", 3 | "version": "0.3.1", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "@isograph/react-disposable-state": "*", 13 | "@types/node": "18.16.3", 14 | "@types/react": "18.3.1", 15 | "@types/react-dom": "18.3.1", 16 | "eslint": "8.39.0", 17 | "eslint-config-next": "13.3.2", 18 | "next": "13.3.2", 19 | "react": "18.3.1", 20 | "react-dom": "18.3.1", 21 | "react-no-ssr": "^1.1.0", 22 | "typescript": "5.6.3" 23 | }, 24 | "devDependencies": { 25 | "@types/react-no-ssr": "^1.1.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /demos/disposable-state-ajax-demo/src/components/Card.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactNode } from 'react'; 2 | 3 | /** 4 | * The root component for posts. It lazily loads all posts, and renders them. 5 | */ 6 | export function Card({ 7 | title, 8 | body, 9 | author, 10 | }: { 11 | title: ReactNode; 12 | body: ReactNode; 13 | author: ReactNode | null; 14 | }) { 15 | return ( 16 | 17 |

{title}

18 | {author != null ?
{author}
: null} 19 | {body} 20 |
21 | ); 22 | } 23 | 24 | function CardChrome({ children }: { children: ReactNode }) { 25 | return ( 26 |
27 |
{children}
28 |
29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /demos/disposable-state-ajax-demo/src/components/PromiseWrapper.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Invariant: 3 | * Before the promise is resolved, value becomes non-null. 4 | */ 5 | export type PromiseWrapper = { 6 | promise: Promise; 7 | value: T | null; 8 | }; 9 | 10 | export function wrapPromise( 11 | promise: Promise, 12 | ): PromiseWrapper { 13 | // TODO confirm suspense works if the promise is already resolved. 14 | const wrapper: PromiseWrapper = { promise, value: null }; 15 | promise.then((v) => { 16 | wrapper.value = v; 17 | }); 18 | return wrapper; 19 | } 20 | 21 | export function useReadPromise(p: PromiseWrapper): T { 22 | if (p.value != null) { 23 | return p.value; 24 | } 25 | throw p.promise; 26 | } 27 | -------------------------------------------------------------------------------- /demos/disposable-state-ajax-demo/src/pages/_app.tsx: -------------------------------------------------------------------------------- 1 | import type { AppProps } from 'next/app'; 2 | 3 | export default function App({ Component, pageProps }: AppProps) { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /demos/disposable-state-ajax-demo/src/pages/_document.tsx: -------------------------------------------------------------------------------- 1 | import { Head, Html, Main, NextScript } from 'next/document'; 2 | 3 | export default function Document() { 4 | return ( 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /demos/disposable-state-ajax-demo/src/pages/lazy-loaded.tsx: -------------------------------------------------------------------------------- 1 | import { LazyLoadPostsWrapper } from '@/components/LazyLoadPostsPage'; 2 | import Head from 'next/head'; 3 | 4 | export default function Home() { 5 | return ( 6 | <> 7 | 8 | Lazy loading demonstration 9 | 13 | 14 |
15 | 16 |
17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /demos/disposable-state-ajax-demo/src/pages/preloaded.tsx: -------------------------------------------------------------------------------- 1 | import { PreloadedPostsWrapper } from '@/components/PreloadedPostsPage'; 2 | import Head from 'next/head'; 3 | 4 | export default function Home() { 5 | return ( 6 | <> 7 | 8 | Preloading demonstration 9 | 13 | 14 |
15 | 16 |
17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /demos/disposable-state-ajax-demo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "noEmit": true, 10 | "esModuleInterop": true, 11 | "module": "esnext", 12 | "moduleResolution": "node", 13 | "resolveJsonModule": true, 14 | "isolatedModules": true, 15 | "jsx": "preserve", 16 | "incremental": true, 17 | "paths": { 18 | "@/*": ["./src/*"] 19 | } 20 | }, 21 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], 22 | "exclude": ["node_modules"] 23 | } 24 | -------------------------------------------------------------------------------- /demos/github-demo/.babelrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["next/babel"], 3 | "plugins": ["../../libs/isograph-babel-plugin/BabelPluginIsograph"] 4 | } 5 | -------------------------------------------------------------------------------- /demos/github-demo/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /demos/github-demo/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | 27 | # local env files 28 | .env*.local 29 | 30 | # vercel 31 | .vercel 32 | 33 | # typescript 34 | *.tsbuildinfo 35 | next-env.d.ts 36 | 37 | .vscode 38 | 39 | node_modules 40 | .next 41 | -------------------------------------------------------------------------------- /demos/github-demo/isograph.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../libs/isograph-compiler/isograph-config-schema.json", 3 | "project_root": "./src/isograph-components", 4 | "schema": "./schema.graphql", 5 | "options": { 6 | "on_invalid_id_type": "ignore" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /demos/github-demo/next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = {}; 3 | 4 | module.exports = nextConfig; 5 | -------------------------------------------------------------------------------- /demos/github-demo/scripts/deploy.sh: -------------------------------------------------------------------------------- 1 | 2 | set -e 3 | 4 | rm -rf ./out 5 | npm run build 6 | 7 | cd ./out 8 | 9 | aws s3 rm s3://rb-pw-front/isograph-demo --recursive 10 | aws s3 cp . s3://rb-pw-front/isograph-demo --acl public-read --recursive 11 | aws s3 cp ./index.html s3://rb-pw-front/isograph-demo --acl public-read --cache-control max-age=0,no-cache --metadata-directive REPLACE 12 | aws cloudfront create-invalidation --distribution-id E3QXR86BT07VQ8 --paths "/*" 13 | -------------------------------------------------------------------------------- /demos/github-demo/src/.eslintignore: -------------------------------------------------------------------------------- 1 | **/* 2 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/RepoGitHubLink.tsx: -------------------------------------------------------------------------------- 1 | import { Alert, Link } from '@mui/material'; 2 | 3 | export const RepoGitHubLink = ({ 4 | children, 5 | filePath, 6 | }: { 7 | children: string; 8 | filePath: string; 9 | }) => { 10 | return ( 11 | 12 | Find the source code for the{' '} 13 | 16 | {children} 17 | 18 | 19 | ); 20 | }; 21 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Actor/UserLink/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { UserLink as resolver } from '../../../UserLink'; 4 | export type Actor__UserLink__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Actor/UserLink/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type Actor__UserLink__param = { 3 | readonly data: { 4 | /** 5 | The username of the actor. 6 | */ 7 | readonly login: string, 8 | /** 9 | A client pointer for the User type. 10 | */ 11 | readonly asUser: ({ 12 | /** 13 | The Node ID of the User object 14 | */ 15 | readonly id: string, 16 | /** 17 | The user's Twitter username. 18 | */ 19 | readonly twitterUsername: (string | null), 20 | } | null), 21 | }, 22 | readonly parameters: Record, 23 | }; 24 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Actor/asUser/resolver_reader.ts: -------------------------------------------------------------------------------- 1 | import type { EagerReaderArtifact, ReaderAst, Link } from '@isograph/react'; 2 | 3 | const readerAst: ReaderAst<{ data: any, parameters: Record }> = [ 4 | { 5 | kind: "Scalar", 6 | fieldName: "__typename", 7 | alias: null, 8 | arguments: null, 9 | isUpdatable: false, 10 | }, 11 | { 12 | kind: "Link", 13 | alias: "link", 14 | }, 15 | ]; 16 | 17 | const artifact: EagerReaderArtifact< 18 | { data: any, parameters: Record }, 19 | Link | null 20 | > = { 21 | kind: "EagerReaderArtifact", 22 | fieldName: "Actor.asUser", 23 | resolver: ({ data }) => data.__typename === "User" ? data.link : null, 24 | readerAst, 25 | hasUpdatable: false, 26 | }; 27 | 28 | export default artifact; 29 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/IssueComment/formattedCommentCreationDate/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { formattedCommentCreationDate as resolver } from '../../../CommentList'; 3 | export type IssueComment__formattedCommentCreationDate__output_type = ReturnType; -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/IssueComment/formattedCommentCreationDate/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type IssueComment__formattedCommentCreationDate__param = { 3 | readonly data: { 4 | /** 5 | Identifies the date and time when the object was created. 6 | */ 7 | readonly createdAt: string, 8 | }, 9 | readonly parameters: Record, 10 | }; 11 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/PullRequest/CommentList/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { CommentList as resolver } from '../../../CommentList'; 4 | export type PullRequest__CommentList__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/PullRequest/CommentList/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type PullRequest__CommentList__parameters = { 2 | readonly last: number, 3 | }; 4 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/PullRequest/PullRequestLink/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PullRequestLink as resolver } from '../../../PullRequestLink'; 4 | export type PullRequest__PullRequestLink__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/PullRequest/PullRequestLink/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type PullRequest__PullRequestLink__param = { 3 | readonly data: { 4 | /** 5 | Identifies the pull request number. 6 | */ 7 | readonly number: number, 8 | /** 9 | The repository associated with this node. 10 | */ 11 | readonly repository: { 12 | /** 13 | The name of the repository. 14 | */ 15 | readonly name: string, 16 | /** 17 | The User owner of the repository. 18 | */ 19 | readonly owner: { 20 | /** 21 | The username used to login. 22 | */ 23 | readonly login: string, 24 | }, 25 | }, 26 | }, 27 | readonly parameters: Record, 28 | }; 29 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/PullRequest/createdAtFormatted/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { createdAtFormatted as resolver } from '../../../PullRequestTable'; 3 | export type PullRequest__createdAtFormatted__output_type = ReturnType; -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/PullRequest/createdAtFormatted/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type PullRequest__createdAtFormatted__param = { 3 | readonly data: { 4 | /** 5 | Identifies the date and time when the object was created. 6 | */ 7 | readonly createdAt: string, 8 | }, 9 | readonly parameters: Record, 10 | }; 11 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/PullRequestConnection/PullRequestTable/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PullRequestTable as resolver } from '../../../PullRequestTable'; 4 | export type PullRequestConnection__PullRequestTable__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/Header/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { Header as resolver } from '../../../header'; 4 | export type Query__Header__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/Header/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type User__Avatar__output_type } from '../../User/Avatar/output_type'; 2 | 3 | export type Query__Header__param = { 4 | readonly data: { 5 | /** 6 | The currently authenticated user. 7 | */ 8 | readonly viewer: { 9 | /** 10 | The user's public profile name. 11 | */ 12 | readonly name: (string | null), 13 | readonly Avatar: User__Avatar__output_type, 14 | }, 15 | }, 16 | readonly parameters: Record, 17 | }; 18 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/HomePage/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { HomePage as resolver } from '../../../HomeRoute'; 4 | export type Query__HomePage__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/HomePage/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Query__Header__output_type } from '../../Query/Header/output_type'; 2 | import { type Query__HomePageList__output_type } from '../../Query/HomePageList/output_type'; 3 | 4 | export type Query__HomePage__param = { 5 | readonly data: { 6 | readonly Header: Query__Header__output_type, 7 | readonly HomePageList: Query__HomePageList__output_type, 8 | }, 9 | readonly parameters: Record, 10 | }; 11 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/HomePageList/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { HomePageList as resolver } from '../../../HomePageList'; 4 | export type Query__HomePageList__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/PullRequest/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PullRequest as resolver } from '../../../PullRequestRoute'; 4 | export type Query__PullRequest__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/PullRequest/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Query__Header__output_type } from '../../Query/Header/output_type'; 2 | import { type Query__PullRequestDetail__output_type } from '../../Query/PullRequestDetail/output_type'; 3 | import type { Query__PullRequest__parameters } from './parameters_type'; 4 | 5 | export type Query__PullRequest__param = { 6 | readonly data: { 7 | readonly Header: Query__Header__output_type, 8 | readonly PullRequestDetail: Query__PullRequestDetail__output_type, 9 | }, 10 | readonly parameters: Query__PullRequest__parameters, 11 | }; 12 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/PullRequest/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Query__PullRequest__parameters = { 2 | readonly repositoryOwner: string, 3 | readonly repositoryName: string, 4 | readonly pullRequestNumber: number, 5 | }; 6 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/PullRequestDetail/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PullRequestDetail as resolver } from '../../../PullRequestDetail'; 4 | export type Query__PullRequestDetail__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/PullRequestDetail/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Query__PullRequestDetail__parameters = { 2 | readonly repositoryOwner: string, 3 | readonly repositoryName: string, 4 | readonly pullRequestNumber: number, 5 | }; 6 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/RepositoryDetail/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { RepositoryDetail as resolver } from '../../../RepositoryDetail'; 4 | export type Query__RepositoryDetail__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/RepositoryDetail/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Query__RepositoryDetail__parameters = { 2 | readonly first?: number | null | void, 3 | readonly repositoryName: string, 4 | readonly repositoryOwner: string, 5 | }; 6 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/RepositoryPage/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { RepositoryPage as resolver } from '../../../RepositoryRoute'; 4 | export type Query__RepositoryPage__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/RepositoryPage/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Query__Header__output_type } from '../../Query/Header/output_type'; 2 | import { type Query__RepositoryDetail__output_type } from '../../Query/RepositoryDetail/output_type'; 3 | import type { Query__RepositoryPage__parameters } from './parameters_type'; 4 | 5 | export type Query__RepositoryPage__param = { 6 | readonly data: { 7 | readonly Header: Query__Header__output_type, 8 | readonly RepositoryDetail: Query__RepositoryDetail__output_type, 9 | }, 10 | readonly parameters: Query__RepositoryPage__parameters, 11 | }; 12 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/RepositoryPage/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Query__RepositoryPage__parameters = { 2 | readonly repositoryName: string, 3 | readonly repositoryOwner: string, 4 | readonly first: number, 5 | }; 6 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/UserDetail/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { UserDetail as resolver } from '../../../UserDetail'; 4 | export type Query__UserDetail__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/UserDetail/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type User__RepositoryList__output_type } from '../../User/RepositoryList/output_type'; 2 | import type { Query__UserDetail__parameters } from './parameters_type'; 3 | 4 | export type Query__UserDetail__param = { 5 | readonly data: { 6 | /** 7 | Lookup a user by login. 8 | */ 9 | readonly user: ({ 10 | /** 11 | The user's public profile name. 12 | */ 13 | readonly name: (string | null), 14 | readonly RepositoryList: User__RepositoryList__output_type, 15 | } | null), 16 | }, 17 | readonly parameters: Query__UserDetail__parameters, 18 | }; 19 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/UserDetail/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Query__UserDetail__parameters = { 2 | readonly userLogin: string, 3 | }; 4 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/UserPage/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { UserPage as resolver } from '../../../UserRoute'; 4 | export type Query__UserPage__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/UserPage/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Query__Header__output_type } from '../../Query/Header/output_type'; 2 | import { type Query__UserDetail__output_type } from '../../Query/UserDetail/output_type'; 3 | import type { Query__UserPage__parameters } from './parameters_type'; 4 | 5 | export type Query__UserPage__param = { 6 | readonly data: { 7 | readonly Header: Query__Header__output_type, 8 | readonly UserDetail: Query__UserDetail__output_type, 9 | }, 10 | readonly parameters: Query__UserPage__parameters, 11 | }; 12 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Query/UserPage/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Query__UserPage__parameters = { 2 | readonly userLogin: string, 3 | }; 4 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Repository/IsStarred/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { IsStarred as resolver } from '../../../RepositoryDetail'; 4 | export type Repository__IsStarred__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Repository/IsStarred/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type Repository__IsStarred__param = { 3 | readonly data: { 4 | /** 5 | Returns a count of how many stargazers there are on this object 6 | */ 7 | readonly stargazerCount: number, 8 | /** 9 | Returns a boolean indicating whether the viewing user has starred this starrable. 10 | */ 11 | readonly viewerHasStarred: boolean, 12 | }, 13 | readonly parameters: Record, 14 | }; 15 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Repository/RepositoryLink/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { RepositoryLink as resolver } from '../../../RepositoryLink'; 4 | export type Repository__RepositoryLink__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Repository/RepositoryLink/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type Repository__RepositoryLink__param = { 3 | readonly data: { 4 | /** 5 | The Node ID of the Repository object 6 | */ 7 | readonly id: string, 8 | /** 9 | The name of the repository. 10 | */ 11 | readonly name: string, 12 | /** 13 | The User owner of the repository. 14 | */ 15 | readonly owner: { 16 | /** 17 | The username used to login. 18 | */ 19 | readonly login: string, 20 | }, 21 | }, 22 | readonly parameters: Record, 23 | }; 24 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/Repository/RepositoryRow/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { RepositoryRow as resolver } from '../../../UserRepositoryList'; 4 | export type Repository__RepositoryRow__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/User/Avatar/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { Avatar as resolver } from '../../../avatar'; 4 | export type User__Avatar__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/User/Avatar/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type User__Avatar__param = { 3 | readonly data: { 4 | /** 5 | The user's public profile name. 6 | */ 7 | readonly name: (string | null), 8 | /** 9 | A URL pointing to the user's public avatar. 10 | */ 11 | readonly avatarUrl: string, 12 | }, 13 | readonly parameters: Record, 14 | }; 15 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/User/RepositoryConnection/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { RepositoryConnection as resolver } from '../../../UserRepositoryList'; 3 | export type User__RepositoryConnection__output_type = ReturnType; -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/User/RepositoryConnection/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type User__RepositoryConnection__parameters = { 2 | readonly first?: number | null | void, 3 | readonly after?: string | null | void, 4 | }; 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/User/RepositoryList/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { RepositoryList as resolver } from '../../../UserRepositoryList'; 4 | export type User__RepositoryList__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/User/RepositoryList/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type User__RepositoryConnection__output_type } from '../../User/RepositoryConnection/output_type'; 2 | import { type LoadableField, type ExtractParameters } from '@isograph/react'; 3 | import { type User__RepositoryConnection__param } from '../../User/RepositoryConnection/param_type'; 4 | 5 | export type User__RepositoryList__param = { 6 | readonly data: { 7 | readonly firstPage: User__RepositoryConnection__output_type, 8 | readonly RepositoryConnection: LoadableField< 9 | User__RepositoryConnection__param, 10 | User__RepositoryConnection__output_type 11 | >, 12 | }, 13 | readonly parameters: Record, 14 | }; 15 | -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/__isograph/User/__refetch/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { RefetchQueryNormalizationArtifact } from '@isograph/react'; 3 | export type User____refetch__output_type = (params?: any) => [string, () => void]; -------------------------------------------------------------------------------- /demos/github-demo/src/isograph-components/avatar.tsx: -------------------------------------------------------------------------------- 1 | import { iso } from '@iso'; 2 | import { Avatar as MuiAvatar } from '@mui/material'; 3 | 4 | export const Avatar = iso(` 5 | field User.Avatar @component { 6 | name 7 | avatarUrl 8 | } 9 | `)(function AvatarComponent({ data }) { 10 | return ; 11 | }); 12 | -------------------------------------------------------------------------------- /demos/github-demo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "noEmit": true, 10 | "esModuleInterop": true, 11 | "module": "esnext", 12 | "moduleResolution": "node", 13 | "resolveJsonModule": true, 14 | "isolatedModules": true, 15 | "jsx": "preserve", 16 | "incremental": true, 17 | "allowImportingTsExtensions": true, 18 | "paths": { 19 | "@/*": ["./src/*"], 20 | "@iso": ["./src/isograph-components/__isograph/iso.ts"] 21 | }, 22 | "disableSourceOfProjectReferenceRedirect": false 23 | }, 24 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], 25 | "exclude": ["node_modules"] 26 | } 27 | -------------------------------------------------------------------------------- /demos/pet-demo/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /demos/pet-demo/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | 27 | # local env files 28 | .env*.local 29 | 30 | # vercel 31 | .vercel 32 | 33 | # typescript 34 | *.tsbuildinfo 35 | next-env.d.ts 36 | -------------------------------------------------------------------------------- /demos/pet-demo/backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pet-demo-backend", 3 | "version": "0.3.1", 4 | "private": true, 5 | "type": "module", 6 | "dependencies": { 7 | "graphql": "^16.6.0", 8 | "graphql-yoga": "^4.0.4" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /demos/pet-demo/backend/src/index.js: -------------------------------------------------------------------------------- 1 | import { createServer } from 'node:http'; 2 | import { createYoga } from 'graphql-yoga'; 3 | import { schema } from './schema.js'; 4 | 5 | // Create a Yoga instance with a GraphQL schema. 6 | const yoga = createYoga({ schema }); 7 | 8 | // Pass it into a server to hook into request handlers. 9 | const server = createServer(yoga); 10 | 11 | // Start the server and you're done! 12 | server.listen(4000, () => { 13 | console.info('Server is running on http://localhost:4000/graphql'); 14 | }); 15 | -------------------------------------------------------------------------------- /demos/pet-demo/isograph.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../libs/isograph-compiler/isograph-config-schema.json", 3 | "project_root": "./src/components", 4 | "schema": "./backend/schema.graphql", 5 | "schema_extensions": ["./backend/schema-extension.graphql"], 6 | "options": { 7 | "on_invalid_id_type": "error", 8 | "module": "commonjs" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /demos/pet-demo/next.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | /** @type {import('next').NextConfig} */ 4 | const nextConfig = { 5 | experimental: { 6 | swcPlugins: [ 7 | [ 8 | path.resolve( 9 | __dirname, 10 | '../../libs/isograph-swc-plugin/swc_isograph_plugin.wasm', 11 | ), 12 | { 13 | // must be an absolute path 14 | root_dir: path.resolve(__dirname, '.'), 15 | config: require('./isograph.config.json'), 16 | }, 17 | ], 18 | ], 19 | }, 20 | }; 21 | 22 | module.exports = nextConfig; 23 | -------------------------------------------------------------------------------- /demos/pet-demo/pages/index.tsx: -------------------------------------------------------------------------------- 1 | import { HomeRouteLoader } from '@/src/components/HomeRoute'; 2 | import { FullPageLoading } from '@/src/components/routes'; 3 | import ThemeProvider from '@/src/theme'; 4 | import Head from 'next/head'; 5 | import { Suspense } from 'react'; 6 | 7 | export default function Home() { 8 | return ( 9 | <> 10 | 11 | Robert's Pet List 3000 12 | 13 | 14 | }> 15 | 16 | 17 | 18 | 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /demos/pet-demo/pages/newsfeed.tsx: -------------------------------------------------------------------------------- 1 | import { NewsfeedLoader } from '@/src/components/Newsfeed/NewsfeedRoute'; 2 | import { FullPageLoading } from '@/src/components/routes'; 3 | import ThemeProvider from '@/src/theme'; 4 | import Head from 'next/head'; 5 | import { Suspense } from 'react'; 6 | 7 | export default function Newsfeed() { 8 | return ( 9 | <> 10 | 11 | News feed 12 | 13 | 14 | }> 15 | 16 | 17 | 18 | 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /demos/pet-demo/public/henry.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/demos/pet-demo/public/henry.jpg -------------------------------------------------------------------------------- /demos/pet-demo/public/kiki.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/demos/pet-demo/public/kiki.jpg -------------------------------------------------------------------------------- /demos/pet-demo/public/makayla.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/demos/pet-demo/public/makayla.jpg -------------------------------------------------------------------------------- /demos/pet-demo/public/makayla_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/demos/pet-demo/public/makayla_2.jpg -------------------------------------------------------------------------------- /demos/pet-demo/public/makayla_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/demos/pet-demo/public/makayla_3.jpg -------------------------------------------------------------------------------- /demos/pet-demo/public/mimi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/demos/pet-demo/public/mimi.jpg -------------------------------------------------------------------------------- /demos/pet-demo/public/rezor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/demos/pet-demo/public/rezor.jpg -------------------------------------------------------------------------------- /demos/pet-demo/public/tiberius.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/demos/pet-demo/public/tiberius.jpg -------------------------------------------------------------------------------- /demos/pet-demo/src/components/ErrorBoundary.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export class ErrorBoundary extends React.Component< 4 | { children: React.ReactNode }, 5 | { hasError: boolean } 6 | > { 7 | constructor(props: { children: React.ReactNode }) { 8 | super(props); 9 | this.state = { hasError: false }; 10 | } 11 | 12 | static getDerivedStateFromError() { 13 | return { hasError: true }; 14 | } 15 | 16 | render() { 17 | if (this.state.hasError) { 18 | return

Something went wrong.

; 19 | } 20 | 21 | return this.props.children; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/Newsfeed/AdItemDisplayWrapper.tsx: -------------------------------------------------------------------------------- 1 | import { iso } from '@iso'; 2 | import { FragmentReader, useClientSideDefer } from '@isograph/react'; 3 | import React from 'react'; 4 | 5 | export const AdItemDisplayWrapper = iso(` 6 | field AdItem.AdItemDisplayWrapper @component { 7 | AdItemDisplay @loadable(lazyLoadArtifact: true) 8 | } 9 | `)(( 10 | { data }, 11 | { onVisible, index }: { onVisible: (() => void) | null; index: number }, 12 | ) => { 13 | const { fragmentReference } = useClientSideDefer(data.AdItemDisplay); 14 | 15 | return ( 16 | 20 | ); 21 | }); 22 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/Newsfeed/BlogItemMoreDetail.tsx: -------------------------------------------------------------------------------- 1 | import { iso } from '@iso'; 2 | import React from 'react'; 3 | 4 | export const BlogItemMoreDetail = iso(` 5 | field BlogItem.BlogItemMoreDetail @component { 6 | moreContent 7 | } 8 | `)(({ data: blogItem }) => { 9 | return blogItem.moreContent 10 | .split('\n') 11 | .map((paragraph, index) =>

{paragraph}

); 12 | }); 13 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/Newsfeed/ImageDisplay.tsx: -------------------------------------------------------------------------------- 1 | import { iso } from '@iso'; 2 | import { CardMedia } from '@mui/material'; 3 | import React from 'react'; 4 | 5 | export const ImageDisplay = iso(` 6 | field Image.ImageDisplay @component { 7 | url 8 | } 9 | `)(({ data: image }) => ( 10 | 16 | )); 17 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/Newsfeed/NewsfeedPagination.tsx: -------------------------------------------------------------------------------- 1 | import { iso } from '@iso'; 2 | import React from 'react'; 3 | 4 | export const NewsfeedPaginationComponent = iso(` 5 | field Viewer.NewsfeedPaginationComponent($skip: Int!, $limit: Int!) { 6 | newsfeed(skip: $skip, limit: $limit) { 7 | asAdItem { 8 | id 9 | } 10 | asBlogItem { 11 | id 12 | } 13 | NewsfeedAdOrBlog 14 | } 15 | } 16 | `)(({ data }) => { 17 | return data.newsfeed; 18 | }); 19 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/PetMakeFirstCheckinSuperButton.tsx: -------------------------------------------------------------------------------- 1 | import { iso } from '@iso'; 2 | import { Button } from '@mui/material'; 3 | import React from 'react'; 4 | 5 | export const FirstCheckinMakeSuperButton = iso(` 6 | field Pet.FirstCheckinMakeSuperButton @component { 7 | checkins(skip: 0, limit: 1) { 8 | make_super 9 | # location is unused in this component, but we need to select it 10 | # because we need it to show up in the refetch query response, so 11 | # that it can update the rendered CheckinDisplay 12 | location 13 | } 14 | } 15 | `)(({ data }) => { 16 | return ( 17 | 25 | ); 26 | }); 27 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/PetPhraseCard.tsx: -------------------------------------------------------------------------------- 1 | import { iso } from '@iso'; 2 | import { Card, CardContent } from '@mui/material'; 3 | import React from 'react'; 4 | 5 | export const PetPhraseCard = iso(` 6 | field Pet.PetPhraseCard @component { 7 | id 8 | favorite_phrase 9 | } 10 | `)(function PetPhraseCardComponent({ data }) { 11 | return ( 12 | 16 | 17 |

Likes to say

18 |

"{data.favorite_phrase}"

19 |
20 |
21 | ); 22 | }); 23 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/UnreachableFromEntrypoint.tsx: -------------------------------------------------------------------------------- 1 | import { iso } from '@iso'; 2 | 3 | /** 4 | * This file exists just to ensure that we generate the proper artifacts 5 | * for fields that are not accessible from entrypoints. If this fails to 6 | * typecheck, we know we have broken something. 7 | */ 8 | 9 | export const unreachableFromEntrypoint = iso(` 10 | field Pet.UnreachableFromEntrypoint { 11 | id 12 | Unreachable2 13 | set_best_friend_do_not_use 14 | } 15 | `)((data) => {}); 16 | 17 | export const Unreachable2 = iso(` 18 | field Pet.Unreachable2 { 19 | id 20 | } 21 | `)((data) => {}); 22 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/AdItem/AdItemDisplay/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { BlogItem as resolver } from '../../../Newsfeed/AdItem'; 4 | export type AdItem__AdItemDisplay__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/AdItem/AdItemDisplay/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type AdItem__AdItemDisplay__param = { 3 | readonly data: { 4 | readonly advertiser: string, 5 | readonly message: string, 6 | }, 7 | readonly parameters: Record, 8 | }; 9 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/AdItem/AdItemDisplay/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query AdItemDisplay($id: ID!) {\ 2 | node____id___v_id: node(id: $id) {\ 3 | ... on AdItem {\ 4 | __typename,\ 5 | id,\ 6 | advertiser,\ 7 | message,\ 8 | },\ 9 | },\ 10 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/AdItem/AdItemDisplayWrapper/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { AdItemDisplayWrapper as resolver } from '../../../Newsfeed/AdItemDisplayWrapper'; 4 | export type AdItem__AdItemDisplayWrapper__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/AdItem/AdItemDisplayWrapper/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type AdItem__AdItemDisplay__output_type } from '../../AdItem/AdItemDisplay/output_type'; 2 | import { type LoadableField, type ExtractParameters } from '@isograph/react'; 3 | import { type AdItem__AdItemDisplay__param } from '../../AdItem/AdItemDisplay/param_type'; 4 | 5 | export type AdItem__AdItemDisplayWrapper__param = { 6 | readonly data: { 7 | readonly AdItemDisplay: LoadableField< 8 | AdItem__AdItemDisplay__param, 9 | AdItem__AdItemDisplay__output_type 10 | >, 11 | }, 12 | readonly parameters: Record, 13 | }; 14 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/BlogItem/BlogItemDisplay/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { BlogItem as resolver } from '../../../Newsfeed/BlogItem'; 4 | export type BlogItem__BlogItemDisplay__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/BlogItem/BlogItemMoreDetail/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { BlogItemMoreDetail as resolver } from '../../../Newsfeed/BlogItemMoreDetail'; 4 | export type BlogItem__BlogItemMoreDetail__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/BlogItem/BlogItemMoreDetail/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type BlogItem__BlogItemMoreDetail__param = { 3 | readonly data: { 4 | readonly moreContent: string, 5 | }, 6 | readonly parameters: Record, 7 | }; 8 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/BlogItem/BlogItemMoreDetail/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query BlogItemMoreDetail($id: ID!) {\ 2 | node____id___v_id: node(id: $id) {\ 3 | ... on BlogItem {\ 4 | __typename,\ 5 | id,\ 6 | moreContent,\ 7 | },\ 8 | },\ 9 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Checkin/CheckinDisplay/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { CheckinDisplay as resolver } from '../../../PetCheckinsCard'; 4 | export type Checkin__CheckinDisplay__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Checkin/CheckinDisplay/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Checkin__make_super__output_type } from '../../Checkin/make_super/output_type'; 2 | 3 | export type Checkin__CheckinDisplay__param = { 4 | readonly data: { 5 | readonly location: string, 6 | readonly time: string, 7 | readonly make_super: Checkin__make_super__output_type, 8 | }, 9 | readonly parameters: Record, 10 | }; 11 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Checkin/make_super/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { RefetchQueryNormalizationArtifact } from '@isograph/react'; 3 | export type Checkin__make_super__output_type = (params?: any) => [string, () => void]; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Image/ImageDisplay/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { ImageDisplay as resolver } from '../../../Newsfeed/ImageDisplay'; 4 | export type Image__ImageDisplay__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Image/ImageDisplay/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type Image__ImageDisplay__param = { 3 | readonly data: { 4 | readonly url: string, 5 | }, 6 | readonly parameters: Record, 7 | }; 8 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Image/ImageDisplay/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query ImageDisplay($id: ID!) {\ 2 | node____id___v_id: node(id: $id) {\ 3 | ... on Image {\ 4 | __typename,\ 5 | id,\ 6 | url,\ 7 | },\ 8 | },\ 9 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Image/ImageDisplayWrapper/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { ImageDisplayWrapper as resolver } from '../../../Newsfeed/BlogItem'; 4 | export type Image__ImageDisplayWrapper__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Image/ImageDisplayWrapper/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Image__ImageDisplay__output_type } from '../../Image/ImageDisplay/output_type'; 2 | import { type LoadableField, type ExtractParameters } from '@isograph/react'; 3 | import { type Image__ImageDisplay__param } from '../../Image/ImageDisplay/param_type'; 4 | 5 | export type Image__ImageDisplayWrapper__param = { 6 | readonly data: { 7 | readonly ImageDisplay: LoadableField< 8 | Image__ImageDisplay__param, 9 | Image__ImageDisplay__output_type 10 | >, 11 | }, 12 | readonly parameters: Record, 13 | }; 14 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Mutation/SetTagline/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { setTagline as resolver } from '../../../PetTaglineCard'; 4 | export type Mutation__SetTagline__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Mutation/SetTagline/param_type.ts: -------------------------------------------------------------------------------- 1 | import type { Mutation__SetTagline__parameters } from './parameters_type'; 2 | 3 | export type Mutation__SetTagline__param = { 4 | readonly data: { 5 | readonly set_pet_tagline: { 6 | readonly pet: { 7 | readonly tagline: string, 8 | }, 9 | }, 10 | }, 11 | readonly parameters: Mutation__SetTagline__parameters, 12 | }; 13 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Mutation/SetTagline/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Mutation__SetTagline__parameters = { 2 | readonly input: { 3 | readonly id: string, 4 | readonly tagline: string, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Mutation/SetTagline/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'mutation SetTagline($input: SetPetTaglineParams!) {\ 2 | set_pet_tagline____input___v_input: set_pet_tagline(input: $input) {\ 3 | pet {\ 4 | id,\ 5 | tagline,\ 6 | },\ 7 | },\ 8 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/NewsfeedItem/NewsfeedAdOrBlog/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { NewsfeedAdOrBlog as resolver } from '../../../Newsfeed/NewsfeedRoute'; 4 | export type NewsfeedItem__NewsfeedAdOrBlog__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/FavoritePhraseLoader/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { FavoritePhraseLoader as resolver } from '../../../FavoritePhrase'; 4 | export type Pet__FavoritePhraseLoader__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/FavoritePhraseLoader/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type Pet__FavoritePhraseLoader__param = { 3 | readonly data: { 4 | readonly id: string, 5 | }, 6 | readonly parameters: Record, 7 | }; 8 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/FirstCheckinMakeSuperButton/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { FirstCheckinMakeSuperButton as resolver } from '../../../PetMakeFirstCheckinSuperButton'; 4 | export type Pet__FirstCheckinMakeSuperButton__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/FirstCheckinMakeSuperButton/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Checkin__make_super__output_type } from '../../Checkin/make_super/output_type'; 2 | 3 | export type Pet__FirstCheckinMakeSuperButton__param = { 4 | readonly data: { 5 | readonly checkins: ReadonlyArray<{ 6 | readonly make_super: Checkin__make_super__output_type, 7 | readonly location: string, 8 | }>, 9 | }, 10 | readonly parameters: Record, 11 | }; 12 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetBestFriendCard/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PetBestFriendCard as resolver } from '../../../PetBestFriendCard'; 4 | export type Pet__PetBestFriendCard__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetBestFriendCard/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Pet__PetUpdater__output_type } from '../../Pet/PetUpdater/output_type'; 2 | 3 | export type Pet__PetBestFriendCard__param = { 4 | readonly data: { 5 | readonly id: string, 6 | /** 7 | Pet.PetUpdater 8 | A component to test behavior with respect to mutations. 9 | You can update the best friend and the tagline. 10 | */ 11 | readonly PetUpdater: Pet__PetUpdater__output_type, 12 | readonly best_friend_relationship: ({ 13 | readonly picture_together: (string | null), 14 | readonly best_friend: { 15 | readonly id: string, 16 | readonly name: string, 17 | readonly picture: string, 18 | }, 19 | } | null), 20 | }, 21 | readonly parameters: Record, 22 | }; 23 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetCheckinsCard/__refetch__query_text__0.ts: -------------------------------------------------------------------------------- 1 | export default 'mutation Pet__make_super($checkin_id: ID!) {\ 2 | make_checkin_super____checkin_id___v_checkin_id: make_checkin_super(checkin_id: $checkin_id) {\ 3 | icheckin {\ 4 | ... on Checkin {\ 5 | __typename,\ 6 | id,\ 7 | location,\ 8 | time,\ 9 | },\ 10 | },\ 11 | },\ 12 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetCheckinsCard/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PetCheckinsCard as resolver } from '../../../PetCheckinsCard'; 4 | export type Pet__PetCheckinsCard__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetCheckinsCard/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Checkin__CheckinDisplay__output_type } from '../../Checkin/CheckinDisplay/output_type'; 2 | import type { Pet__PetCheckinsCard__parameters } from './parameters_type'; 3 | 4 | export type Pet__PetCheckinsCard__param = { 5 | readonly data: { 6 | readonly id: string, 7 | readonly checkins: ReadonlyArray<{ 8 | readonly CheckinDisplay: Checkin__CheckinDisplay__output_type, 9 | readonly id: string, 10 | }>, 11 | }, 12 | readonly parameters: Pet__PetCheckinsCard__parameters, 13 | }; 14 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetCheckinsCard/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Pet__PetCheckinsCard__parameters = { 2 | readonly skip?: number | null | void, 3 | readonly limit?: number | null | void, 4 | }; 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetCheckinsCard/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query PetCheckinsCard($skip: Int, $limit: Int, $id: ID!) {\ 2 | node____id___v_id: node(id: $id) {\ 3 | ... on Pet {\ 4 | __typename,\ 5 | id,\ 6 | checkins____skip___v_skip____limit___v_limit: checkins(skip: $skip, limit: $limit) {\ 7 | id,\ 8 | location,\ 9 | time,\ 10 | },\ 11 | },\ 12 | },\ 13 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetCheckinsCardList/__refetch__query_text__0.ts: -------------------------------------------------------------------------------- 1 | export default 'mutation Pet__make_super($checkin_id: ID!) {\ 2 | make_checkin_super____checkin_id___v_checkin_id: make_checkin_super(checkin_id: $checkin_id) {\ 3 | icheckin {\ 4 | ... on Checkin {\ 5 | __typename,\ 6 | id,\ 7 | location,\ 8 | time,\ 9 | },\ 10 | },\ 11 | },\ 12 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetCheckinsCardList/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { PetCheckinsCardList as resolver } from '../../../PetCheckinsCard'; 3 | export type Pet__PetCheckinsCardList__output_type = ReturnType; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetCheckinsCardList/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Checkin__CheckinDisplay__output_type } from '../../Checkin/CheckinDisplay/output_type'; 2 | import type { Pet__PetCheckinsCardList__parameters } from './parameters_type'; 3 | 4 | export type Pet__PetCheckinsCardList__param = { 5 | readonly data: { 6 | readonly checkins: ReadonlyArray<{ 7 | readonly CheckinDisplay: Checkin__CheckinDisplay__output_type, 8 | readonly id: string, 9 | }>, 10 | }, 11 | readonly parameters: Pet__PetCheckinsCardList__parameters, 12 | }; 13 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetCheckinsCardList/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Pet__PetCheckinsCardList__parameters = { 2 | readonly skip: number, 3 | readonly limit: number, 4 | }; 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetCheckinsCardList/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query PetCheckinsCardList($skip: Int!, $limit: Int!, $id: ID!) {\ 2 | node____id___v_id: node(id: $id) {\ 3 | ... on Pet {\ 4 | __typename,\ 5 | id,\ 6 | checkins____skip___v_skip____limit___v_limit: checkins(skip: $skip, limit: $limit) {\ 7 | id,\ 8 | location,\ 9 | time,\ 10 | },\ 11 | },\ 12 | },\ 13 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetDetailDeferredRouteInnerComponent/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PetDetailDeferredRouteInnerComponent as resolver } from '../../../PetDetailDeferredRoute'; 4 | export type Pet__PetDetailDeferredRouteInnerComponent__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetDetailDeferredRouteInnerComponent/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Pet__PetCheckinsCard__output_type } from '../../Pet/PetCheckinsCard/output_type'; 2 | import { type LoadableField, type ExtractParameters } from '@isograph/react'; 3 | import { type Pet__PetCheckinsCard__param } from '../../Pet/PetCheckinsCard/param_type'; 4 | 5 | export type Pet__PetDetailDeferredRouteInnerComponent__param = { 6 | readonly data: { 7 | readonly name: string, 8 | readonly PetCheckinsCard: LoadableField< 9 | Pet__PetCheckinsCard__param, 10 | Pet__PetCheckinsCard__output_type 11 | >, 12 | }, 13 | readonly parameters: Record, 14 | }; 15 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetPhraseCard/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PetPhraseCard as resolver } from '../../../PetPhraseCard'; 4 | export type Pet__PetPhraseCard__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetPhraseCard/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type Pet__PetPhraseCard__param = { 3 | readonly data: { 4 | readonly id: string, 5 | readonly favorite_phrase: (string | null), 6 | }, 7 | readonly parameters: Record, 8 | }; 9 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetStatsCard/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PetStatsCard as resolver } from '../../../PetStatsCard'; 4 | export type Pet__PetStatsCard__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetStatsCard/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Pet__PetStatsCard__parameters = { 2 | readonly id: string, 3 | }; 4 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetSummaryCard/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PetSummaryCard as resolver } from '../../../PetSummaryCard'; 4 | export type Pet__PetSummaryCard__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetSummaryCard/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Pet__FavoritePhraseLoader__output_type } from '../../Pet/FavoritePhraseLoader/output_type'; 2 | 3 | export type Pet__PetSummaryCard__param = { 4 | readonly data: { 5 | readonly id: string, 6 | readonly name: string, 7 | readonly picture: string, 8 | readonly tagline: string, 9 | readonly FavoritePhraseLoader: Pet__FavoritePhraseLoader__output_type, 10 | }, 11 | readonly parameters: Record, 12 | }; 13 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetTaglineCard/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PetTaglineCard as resolver } from '../../../PetTaglineCard'; 4 | export type Pet__PetTaglineCard__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetTaglineCard/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type Pet__PetTaglineCard__param = { 3 | readonly data: { 4 | readonly id: string, 5 | readonly tagline: string, 6 | }, 7 | readonly parameters: Record, 8 | }; 9 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/PetUpdater/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PetUpdater as resolver } from '../../../PetUpdater'; 4 | export type Pet__PetUpdater__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/Unreachable2/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { Unreachable2 as resolver } from '../../../UnreachableFromEntrypoint'; 3 | export type Pet__Unreachable2__output_type = ReturnType; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/Unreachable2/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type Pet__Unreachable2__param = { 3 | readonly data: { 4 | readonly id: string, 5 | }, 6 | readonly parameters: Record, 7 | }; 8 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/UnreachableFromEntrypoint/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Pet__Unreachable2__output_type } from '../../Pet/Unreachable2/output_type'; 2 | import { type Pet__set_best_friend_do_not_use__output_type } from '../../Pet/set_best_friend_do_not_use/output_type'; 3 | 4 | export type Pet__UnreachableFromEntrypoint__param = { 5 | readonly data: { 6 | readonly id: string, 7 | readonly Unreachable2: Pet__Unreachable2__output_type, 8 | readonly set_best_friend_do_not_use: Pet__set_best_friend_do_not_use__output_type, 9 | }, 10 | readonly parameters: Record, 11 | }; 12 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/__refetch/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { RefetchQueryNormalizationArtifact } from '@isograph/react'; 3 | export type Pet____refetch__output_type = (params?: any) => [string, () => void]; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/custom_pet_refetch/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { RefetchQueryNormalizationArtifact } from '@isograph/react'; 3 | export type Pet__custom_pet_refetch__output_type = (params?: any) => [string, () => void]; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/set_best_friend/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { RefetchQueryNormalizationArtifact } from '@isograph/react'; 3 | export type Pet__set_best_friend__output_type = (params?: any) => [string, () => void]; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/set_best_friend_do_not_use/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { RefetchQueryNormalizationArtifact } from '@isograph/react'; 3 | export type Pet__set_best_friend_do_not_use__output_type = (params?: any) => [string, () => void]; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Pet/set_pet_tagline/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { RefetchQueryNormalizationArtifact } from '@isograph/react'; 3 | export type Pet__set_pet_tagline__output_type = (params?: any) => [string, () => void]; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/PetStats/refetch_pet_stats/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { RefetchQueryNormalizationArtifact } from '@isograph/react'; 3 | export type PetStats__refetch_pet_stats__output_type = (params?: any) => [string, () => void]; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/HomeRoute/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { HomeRoute as resolver } from '../../../HomeRoute'; 4 | export type Query__HomeRoute__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/HomeRoute/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Pet__PetSummaryCard__output_type } from '../../Pet/PetSummaryCard/output_type'; 2 | 3 | export type Query__HomeRoute__param = { 4 | readonly data: { 5 | readonly pets: ReadonlyArray<{ 6 | readonly id: string, 7 | readonly PetSummaryCard: Pet__PetSummaryCard__output_type, 8 | }>, 9 | }, 10 | readonly parameters: Record, 11 | }; 12 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/HomeRoute/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query HomeRoute {\ 2 | pets {\ 3 | id,\ 4 | name,\ 5 | picture,\ 6 | tagline,\ 7 | },\ 8 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/Newsfeed/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { Newsfeed as resolver } from '../../../Newsfeed/NewsfeedRoute'; 4 | export type Query__Newsfeed__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/Newsfeed/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Viewer__NewsfeedPaginationComponent__output_type } from '../../Viewer/NewsfeedPaginationComponent/output_type'; 2 | import { type LoadableField, type ExtractParameters } from '@isograph/react'; 3 | import { type Viewer__NewsfeedPaginationComponent__param } from '../../Viewer/NewsfeedPaginationComponent/param_type'; 4 | 5 | export type Query__Newsfeed__param = { 6 | readonly data: { 7 | readonly viewer: { 8 | readonly initial: Viewer__NewsfeedPaginationComponent__output_type, 9 | readonly NewsfeedPaginationComponent: LoadableField< 10 | Viewer__NewsfeedPaginationComponent__param, 11 | Viewer__NewsfeedPaginationComponent__output_type 12 | >, 13 | }, 14 | }, 15 | readonly parameters: Record, 16 | }; 17 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/Newsfeed/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query Newsfeed {\ 2 | viewer {\ 3 | id,\ 4 | newsfeed____skip___l_0____limit___l_6: newsfeed(skip: 0, limit: 6) {\ 5 | __typename,\ 6 | ... on AdItem {\ 7 | id,\ 8 | __typename,\ 9 | },\ 10 | ... on BlogItem {\ 11 | id,\ 12 | __typename,\ 13 | author,\ 14 | content,\ 15 | image {\ 16 | id,\ 17 | },\ 18 | title,\ 19 | },\ 20 | },\ 21 | },\ 22 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetByName/normalization_ast.ts: -------------------------------------------------------------------------------- 1 | import type {NormalizationAst} from '@isograph/react'; 2 | const normalizationAst: NormalizationAst = { 3 | kind: "NormalizationAst", 4 | selections: [ 5 | { 6 | kind: "Linked", 7 | fieldName: "petByName", 8 | arguments: [ 9 | [ 10 | "name", 11 | { kind: "Variable", name: "name" }, 12 | ], 13 | ], 14 | concreteType: "Pet", 15 | selections: [ 16 | { 17 | kind: "Scalar", 18 | fieldName: "id", 19 | arguments: null, 20 | }, 21 | { 22 | kind: "Scalar", 23 | fieldName: "name", 24 | arguments: null, 25 | }, 26 | ], 27 | }, 28 | ], 29 | }; 30 | export default normalizationAst; 31 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetByName/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PetByNameRouteComponent as resolver } from '../../../PetByName'; 4 | export type Query__PetByName__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetByName/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Pet__PetDetailDeferredRouteInnerComponent__output_type } from '../../Pet/PetDetailDeferredRouteInnerComponent/output_type'; 2 | import type { Query__PetByName__parameters } from './parameters_type'; 3 | 4 | export type Query__PetByName__param = { 5 | readonly data: { 6 | readonly pet: ({ 7 | readonly PetDetailDeferredRouteInnerComponent: Pet__PetDetailDeferredRouteInnerComponent__output_type, 8 | } | null), 9 | }, 10 | readonly parameters: Query__PetByName__parameters, 11 | }; 12 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetByName/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Query__PetByName__parameters = { 2 | readonly name: string, 3 | }; 4 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetByName/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query PetByName($name: String!) {\ 2 | petByName____name___v_name: petByName(name: $name) {\ 3 | id,\ 4 | name,\ 5 | },\ 6 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetCheckinListRoute/__refetch__query_text__0.ts: -------------------------------------------------------------------------------- 1 | export default 'mutation Query__make_super($checkin_id: ID!) {\ 2 | make_checkin_super____checkin_id___v_checkin_id: make_checkin_super(checkin_id: $checkin_id) {\ 3 | icheckin {\ 4 | ... on Checkin {\ 5 | __typename,\ 6 | id,\ 7 | location,\ 8 | },\ 9 | },\ 10 | },\ 11 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetCheckinListRoute/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PetDetailDeferredRouteComponent as resolver } from '../../../PetCheckinListRoute'; 4 | export type Query__PetCheckinListRoute__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetCheckinListRoute/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Query__PetCheckinListRoute__parameters = { 2 | readonly id: string, 3 | }; 4 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetCheckinListRoute/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query PetCheckinListRoute($id: ID!) {\ 2 | pet____id___v_id: pet(id: $id) {\ 3 | id,\ 4 | checkins____skip___l_0____limit___l_1: checkins(skip: 0, limit: 1) {\ 5 | id,\ 6 | location,\ 7 | },\ 8 | name,\ 9 | },\ 10 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetDetailDeferredRoute/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PetDetailDeferredRouteComponent as resolver } from '../../../PetDetailDeferredRoute'; 4 | export type Query__PetDetailDeferredRoute__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetDetailDeferredRoute/param_type.ts: -------------------------------------------------------------------------------- 1 | import { type Pet__PetDetailDeferredRouteInnerComponent__output_type } from '../../Pet/PetDetailDeferredRouteInnerComponent/output_type'; 2 | import type { Query__PetDetailDeferredRoute__parameters } from './parameters_type'; 3 | 4 | export type Query__PetDetailDeferredRoute__param = { 5 | readonly data: { 6 | readonly pet: ({ 7 | readonly PetDetailDeferredRouteInnerComponent: Pet__PetDetailDeferredRouteInnerComponent__output_type, 8 | } | null), 9 | readonly topLevelField: ({ 10 | readonly __typename: string, 11 | } | null), 12 | }, 13 | readonly parameters: Query__PetDetailDeferredRoute__parameters, 14 | }; 15 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetDetailDeferredRoute/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Query__PetDetailDeferredRoute__parameters = { 2 | readonly id: string, 3 | }; 4 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetDetailDeferredRoute/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query PetDetailDeferredRoute($id: ID!) {\ 2 | pet____id___v_id: pet(id: $id) {\ 3 | id,\ 4 | name,\ 5 | },\ 6 | topLevelField____input___o_name__s_ThisIsJustHereToTestObjectLiterals_c: topLevelField(input: { name: "ThisIsJustHereToTestObjectLiterals" }) {\ 7 | __typename,\ 8 | },\ 9 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetDetailRoute/__refetch__query_text__4.ts: -------------------------------------------------------------------------------- 1 | export default 'mutation Query__make_super($checkin_id: ID!) {\ 2 | make_checkin_super____checkin_id___v_checkin_id: make_checkin_super(checkin_id: $checkin_id) {\ 3 | icheckin {\ 4 | ... on Checkin {\ 5 | __typename,\ 6 | id,\ 7 | location,\ 8 | time,\ 9 | },\ 10 | },\ 11 | },\ 12 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetDetailRoute/__refetch__query_text__5.ts: -------------------------------------------------------------------------------- 1 | export default 'query Query__refetch_pet_stats($id: ID!) {\ 2 | pet____id___v_id: pet(id: $id) {\ 3 | stats {\ 4 | cuteness,\ 5 | energy,\ 6 | hunger,\ 7 | intelligence,\ 8 | sociability,\ 9 | weight,\ 10 | },\ 11 | },\ 12 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetDetailRoute/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PetDetailRouteComponent as resolver } from '../../../PetDetailRoute'; 4 | export type Query__PetDetailRoute__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetDetailRoute/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Query__PetDetailRoute__parameters = { 2 | readonly id: string, 3 | }; 4 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetFavoritePhrase/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { PetFavoritePhrase as resolver } from '../../../FavoritePhrase'; 4 | export type Query__PetFavoritePhrase__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetFavoritePhrase/param_type.ts: -------------------------------------------------------------------------------- 1 | import type { Query__PetFavoritePhrase__parameters } from './parameters_type'; 2 | 3 | export type Query__PetFavoritePhrase__param = { 4 | readonly data: { 5 | readonly pet: ({ 6 | readonly name: string, 7 | readonly favorite_phrase: (string | null), 8 | } | null), 9 | }, 10 | readonly parameters: Query__PetFavoritePhrase__parameters, 11 | }; 12 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetFavoritePhrase/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Query__PetFavoritePhrase__parameters = { 2 | readonly id: string, 3 | }; 4 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Query/PetFavoritePhrase/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query PetFavoritePhrase($id: ID!) {\ 2 | pet____id___v_id: pet(id: $id) {\ 3 | id,\ 4 | favorite_phrase,\ 5 | name,\ 6 | },\ 7 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Viewer/NewsfeedPaginationComponent/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { NewsfeedPaginationComponent as resolver } from '../../../Newsfeed/NewsfeedPagination'; 3 | export type Viewer__NewsfeedPaginationComponent__output_type = ReturnType; -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Viewer/NewsfeedPaginationComponent/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Viewer__NewsfeedPaginationComponent__parameters = { 2 | readonly skip: number, 3 | readonly limit: number, 4 | }; 5 | -------------------------------------------------------------------------------- /demos/pet-demo/src/components/__isograph/Viewer/NewsfeedPaginationComponent/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query NewsfeedPaginationComponent($skip: Int!, $limit: Int!, $id: ID!) {\ 2 | node____id___v_id: node(id: $id) {\ 3 | ... on Viewer {\ 4 | __typename,\ 5 | id,\ 6 | newsfeed____skip___v_skip____limit___v_limit: newsfeed(skip: $skip, limit: $limit) {\ 7 | __typename,\ 8 | ... on AdItem {\ 9 | id,\ 10 | __typename,\ 11 | },\ 12 | ... on BlogItem {\ 13 | id,\ 14 | __typename,\ 15 | author,\ 16 | content,\ 17 | image {\ 18 | id,\ 19 | },\ 20 | title,\ 21 | },\ 22 | },\ 23 | },\ 24 | },\ 25 | }'; -------------------------------------------------------------------------------- /demos/pet-demo/src/theme.tsx: -------------------------------------------------------------------------------- 1 | import { createTheme, ThemeProvider } from '@mui/material/styles'; 2 | import React from 'react'; 3 | 4 | const theme = createTheme({ 5 | spacing: 4, 6 | palette: { 7 | primary: { 8 | light: '#788caf', 9 | main: '#385276', 10 | dark: '#1a2f4a', 11 | contrastText: '#fff', 12 | }, 13 | secondary: { 14 | light: '#ff7961', 15 | main: '#f28800', 16 | dark: '#e86600', 17 | contrastText: '#000', 18 | }, 19 | }, 20 | }); 21 | 22 | export default function PetDemoThemeProvider({ 23 | children, 24 | }: any): React.ReactNode { 25 | return {children}; 26 | } 27 | -------------------------------------------------------------------------------- /demos/pet-demo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "allowImportingTsExtensions": true, 17 | "paths": { 18 | "@/*": ["./*"], 19 | "@iso": ["./src/components/__isograph/iso.ts"] 20 | } 21 | }, 22 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "backend/src/index.js"], 23 | "exclude": ["node_modules"] 24 | } 25 | -------------------------------------------------------------------------------- /demos/vite-demo/.babelrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-typescript"], 3 | "plugins": ["../../libs/isograph-babel-plugin/BabelPluginIsograph"] 4 | } 5 | -------------------------------------------------------------------------------- /demos/vite-demo/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /demos/vite-demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Vite + Isograph Demo 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /demos/vite-demo/isograph.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../libs/isograph-compiler/isograph-config-schema.json", 3 | "project_root": "./src/components", 4 | "schema": "./schema.graphql", 5 | "options": { 6 | "module": "esmodule" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /demos/vite-demo/src/components/HomePageRoute.tsx: -------------------------------------------------------------------------------- 1 | import { iso } from '@iso'; 2 | import { useLazyReference, useResult } from '@isograph/react'; 3 | 4 | export default function HomePageRoute() { 5 | const { fragmentReference } = useLazyReference( 6 | iso(`entrypoint Query.HomePage`), 7 | {}, 8 | ); 9 | const HomePage = useResult(fragmentReference); 10 | return ; 11 | } 12 | -------------------------------------------------------------------------------- /demos/vite-demo/src/components/__isograph/Pokemon/Pokemon/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { Pokemon as resolver } from '../../../Pokemon'; 4 | export type Pokemon__Pokemon__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/vite-demo/src/components/__isograph/Pokemon/Pokemon/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type Pokemon__Pokemon__param = { 3 | readonly data: { 4 | /** 5 | The dex number for a Pokémon 6 | */ 7 | readonly num: number, 8 | /** 9 | The species name for a Pokémon 10 | */ 11 | readonly species: string, 12 | /** 13 | The sprite for a Pokémon. For most Pokémon this will be the animated gif, with some exceptions that were older-gen exclusive 14 | */ 15 | readonly sprite: string, 16 | /** 17 | Bulbapedia page for a Pokémon 18 | */ 19 | readonly bulbapediaPage: string, 20 | }, 21 | readonly parameters: Record, 22 | }; 23 | -------------------------------------------------------------------------------- /demos/vite-demo/src/components/__isograph/Query/HomePage/output_type.ts: -------------------------------------------------------------------------------- 1 | import type { ExtractSecondParam, CombineWithIntrinsicAttributes } from '@isograph/react'; 2 | import type React from 'react'; 3 | import { HomePage as resolver } from '../../../HomePage'; 4 | export type Query__HomePage__output_type = (React.FC>>); 5 | -------------------------------------------------------------------------------- /demos/vite-demo/src/components/__isograph/Query/HomePage/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query HomePage {\ 2 | getAllPokemon____take___l_232____offset___l_93: getAllPokemon(take: 232, offset: 93) {\ 3 | bulbapediaPage,\ 4 | forme,\ 5 | key,\ 6 | num,\ 7 | species,\ 8 | sprite,\ 9 | },\ 10 | }'; -------------------------------------------------------------------------------- /demos/vite-demo/src/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; 3 | line-height: 1.5; 4 | font-weight: 400; 5 | 6 | color-scheme: light dark; 7 | color: rgba(255, 255, 255, 0.87); 8 | background-color: #242424; 9 | 10 | font-synthesis: none; 11 | text-rendering: optimizeLegibility; 12 | -webkit-font-smoothing: antialiased; 13 | -moz-osx-font-smoothing: grayscale; 14 | } 15 | 16 | body { 17 | margin: 0; 18 | display: flex; 19 | place-items: center; 20 | min-width: 320px; 21 | min-height: 100vh; 22 | } 23 | -------------------------------------------------------------------------------- /demos/vite-demo/src/main.tsx: -------------------------------------------------------------------------------- 1 | import { createRoot } from 'react-dom/client'; 2 | import App from './App.tsx'; 3 | import './index.css'; 4 | 5 | createRoot(document.getElementById('root')!).render(); 6 | -------------------------------------------------------------------------------- /demos/vite-demo/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /demos/vite-demo/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "lib": ["dom", "dom.iterable", "esnext"], 6 | "module": "ESNext", 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "isolatedModules": true, 13 | "moduleDetection": "force", 14 | "emitDeclarationOnly": true, 15 | "jsx": "react-jsx", 16 | 17 | /* Linting */ 18 | "strict": true, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "noFallthroughCasesInSwitch": true, 22 | 23 | /* Paths */ 24 | "paths": { 25 | "@iso": ["./src/components/__isograph/iso.ts"] 26 | }, 27 | 28 | "composite": true 29 | }, 30 | "include": ["src"] 31 | } 32 | -------------------------------------------------------------------------------- /demos/vite-demo/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2022", 4 | "lib": ["ES2023"], 5 | "module": "ESNext", 6 | "skipLibCheck": true, 7 | 8 | /* Bundler mode */ 9 | "moduleResolution": "bundler", 10 | "allowImportingTsExtensions": true, 11 | "isolatedModules": true, 12 | "moduleDetection": "force", 13 | "emitDeclarationOnly": true, 14 | 15 | /* Linting */ 16 | "strict": true, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "noFallthroughCasesInSwitch": true, 20 | 21 | "composite": true 22 | }, 23 | "include": ["vite.config.ts"] 24 | } 25 | -------------------------------------------------------------------------------- /demos/vite-demo/vite.config.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import react from '@vitejs/plugin-react'; 3 | import { defineConfig } from 'vite'; 4 | 5 | // https://vitejs.dev/config/ 6 | export default defineConfig({ 7 | plugins: [ 8 | react({ 9 | babel: { 10 | babelrc: true, 11 | }, 12 | }), 13 | ], 14 | resolve: { 15 | alias: { 16 | '@iso': path.resolve(__dirname, './src/components/__isograph/iso.ts'), 17 | }, 18 | }, 19 | optimizeDeps: { 20 | include: ['@isograph/react'], 21 | }, 22 | }); 23 | -------------------------------------------------------------------------------- /docs-website/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | **/build/** 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /docs-website/README.md: -------------------------------------------------------------------------------- 1 | # Website 2 | 3 | This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. 4 | 5 | ### Installation 6 | 7 | ``` 8 | $ yarn 9 | ``` 10 | 11 | ### Local Development 12 | 13 | ``` 14 | $ yarn start 15 | ``` 16 | 17 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. 18 | 19 | ### Build 20 | 21 | ``` 22 | $ yarn build 23 | ``` 24 | 25 | This command generates static content into the `build` directory and can be served using any static contents hosting service. 26 | 27 | ### Deployment 28 | 29 | Done as part of GitHub actions. 30 | -------------------------------------------------------------------------------- /docs-website/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /docs-website/blog/authors.yml: -------------------------------------------------------------------------------- 1 | robertbalicki: 2 | name: Robert Balicki 3 | title: Isograph maintainer 4 | url: https://www.robertbalicki.com 5 | image_url: https://avatars.githubusercontent.com/u/4277077 6 | -------------------------------------------------------------------------------- /docs-website/docs/assets/data-type-short.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/docs-website/docs/assets/data-type-short.png -------------------------------------------------------------------------------- /docs-website/docs/assets/data-type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/docs-website/docs/assets/data-type.png -------------------------------------------------------------------------------- /docs-website/src/components/Buttons/index.tsx: -------------------------------------------------------------------------------- 1 | import Link from '@docusaurus/Link'; 2 | import styles from './styles.module.css'; 3 | 4 | export default function () { 5 | return ( 6 |
7 | 11 | Quickstart 12 | 13 | 17 | See a demo app 18 | 19 |
20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /docs-website/src/components/Buttons/styles.module.css: -------------------------------------------------------------------------------- 1 | .buttons { 2 | display: flex; 3 | align-items: center; 4 | justify-content: center; 5 | gap: 1em; 6 | } 7 | 8 | @media screen and (max-width: 996px) { 9 | .buttons { 10 | flex-direction: column; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docs-website/src/components/CodeBlock.tsx: -------------------------------------------------------------------------------- 1 | import CodeBlock from '@theme/CodeBlock'; 2 | 3 | export default function MyCodeBlock(props) { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /docs-website/src/pages/tweet.tsx: -------------------------------------------------------------------------------- 1 | import Layout from '@theme/Layout'; 2 | import { TwitterTweetEmbed } from 'react-twitter-embed'; 3 | 4 | export default function Home(): JSX.Element { 5 | return ( 6 | 10 |
11 |
18 |
19 | 20 |
21 |
22 |
23 |
24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /docs-website/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/docs-website/static/.nojekyll -------------------------------------------------------------------------------- /docs-website/static/fonts/GTEestiDisplay-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/docs-website/static/fonts/GTEestiDisplay-Bold.woff2 -------------------------------------------------------------------------------- /docs-website/static/fonts/MaisonNeue-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/docs-website/static/fonts/MaisonNeue-Bold.woff2 -------------------------------------------------------------------------------- /docs-website/static/fonts/MaisonNeue-Book.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/docs-website/static/fonts/MaisonNeue-Book.woff2 -------------------------------------------------------------------------------- /docs-website/static/fonts/MaisonNeue-Demi.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/docs-website/static/fonts/MaisonNeue-Demi.woff2 -------------------------------------------------------------------------------- /docs-website/static/fonts/MaisonNeue-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/docs-website/static/fonts/MaisonNeue-Medium.woff2 -------------------------------------------------------------------------------- /docs-website/static/img/isograph_logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/docs-website/static/img/isograph_logo.ico -------------------------------------------------------------------------------- /docs-website/static/img/isograph_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isographlabs/isograph/88ca38d29fb6c9592740614f1ed04abdb48650e3/docs-website/static/img/isograph_logo.png -------------------------------------------------------------------------------- /docs-website/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // This file is not used in compilation. It is here just for a nice editor experience. 3 | "extends": "@docusaurus/tsconfig", 4 | "compilerOptions": { 5 | "baseUrl": "." 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/isograph-babel-plugin/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./BabelPluginIsograph.js'); 2 | -------------------------------------------------------------------------------- /libs/isograph-babel-plugin/stub.ts: -------------------------------------------------------------------------------- 1 | import type cosmiconfig from 'cosmiconfig'; 2 | 3 | declare module 'cosmiconfig' { 4 | export const loadJson: cosmiconfig.LoaderEntry; 5 | } 6 | 7 | export {}; 8 | -------------------------------------------------------------------------------- /libs/isograph-babel-plugin/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "allowJs": true, 5 | "checkJs": true, 6 | "noEmit": true 7 | }, 8 | "include": ["./**/*.ts", "./**/*.js"] 9 | } 10 | -------------------------------------------------------------------------------- /libs/isograph-compiler/README.md: -------------------------------------------------------------------------------- 1 | # `@isograph/compiler` 2 | 3 | This package installs the Isograph compiler under the `yarn iso` command. 4 | 5 | ## Usage 6 | 7 | ```bash 8 | yarn iso --config ./isograph.config.json 9 | # or 10 | yarn iso --config ./isograph.config.json --watch 11 | ``` 12 | 13 | ## Requirements 14 | 15 | This requires a valid Isograph config. See [the Isograph config docs](../../docs-website/docs/isograph-config.md). 16 | 17 | :::warning 18 | `yarn iso --config $PATH` will work if the config is not named `isograph.config.json`, or is not found in the root of the project. But the babel plugin will not (yet!) 19 | ::: 20 | 21 | ## Options 22 | 23 | - `--config` this is required, and is a relative path to the Isograph config. 24 | - `--watch` if passed, this starts the compiler in watch mode. 25 | -------------------------------------------------------------------------------- /libs/isograph-compiler/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 'use strict'; 3 | 4 | var bin = require('.'); 5 | var spawn = require('child_process').spawn; 6 | 7 | var input = process.argv.slice(2); 8 | 9 | if (bin !== null) { 10 | spawn(bin, input, { stdio: 'inherit' }).on('exit', process.exit); 11 | } else { 12 | throw new Error( 13 | `Platform "${process.platform} (${process.arch})" not supported.`, 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /libs/isograph-compiler/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@isograph/compiler", 3 | "version": "0.3.1", 4 | "description": "Installs the `yarn iso` command, which runs the Isograph compiler.", 5 | "homepage": "https://isograph.dev", 6 | "main": "index.js", 7 | "bin": { 8 | "iso": "cli.js" 9 | }, 10 | "author": "Isograph Labs", 11 | "license": "MIT", 12 | "scripts": {}, 13 | "repository": { 14 | "type": "git", 15 | "url": "git+https://github.com/isographlabs/isograph.git", 16 | "directory": "libs/isograph-compiler" 17 | }, 18 | "sideEffects": false 19 | } 20 | -------------------------------------------------------------------------------- /libs/isograph-disposable-types/src/index.ts: -------------------------------------------------------------------------------- 1 | export type CleanupFn = () => void; 2 | export type ItemCleanupPair = [T, CleanupFn]; 3 | export type Factory = () => ItemCleanupPair; 4 | -------------------------------------------------------------------------------- /libs/isograph-disposable-types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.pkg.json", 3 | "compilerOptions": { 4 | "noEmit": true 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /libs/isograph-disposable-types/tsconfig.pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/", 5 | "rootDir": "./src/", 6 | "declaration": true, 7 | "jsx": "react" 8 | }, 9 | "include": ["./**/*.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/isograph-react-disposable-state/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from '@isograph/disposable-types'; 2 | 3 | export * from './CacheItem'; 4 | export * from './ParentCache'; 5 | export * from './useCachedResponsivePrecommitValue'; 6 | export * from './useDisposableState'; 7 | export * from './useHasCommittedRef'; 8 | export * from './useLazyDisposableState'; 9 | export * from './useUpdatableDisposableState'; 10 | -------------------------------------------------------------------------------- /libs/isograph-react-disposable-state/src/useHasCommittedRef.ts: -------------------------------------------------------------------------------- 1 | import { MutableRefObject, useEffect, useRef } from 'react'; 2 | 3 | /** 4 | * Returns true if the component has committed, false otherwise. 5 | */ 6 | export function useHasCommittedRef(): MutableRefObject { 7 | const hasCommittedRef = useRef(false); 8 | useEffect(() => { 9 | hasCommittedRef.current = true; 10 | }, []); 11 | return hasCommittedRef; 12 | } 13 | -------------------------------------------------------------------------------- /libs/isograph-react-disposable-state/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.pkg.json", 3 | "compilerOptions": { 4 | "noEmit": true 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /libs/isograph-react-disposable-state/tsconfig.pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/", 5 | "rootDir": "./src/", 6 | "declaration": true 7 | }, 8 | "include": ["./**/*.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /libs/isograph-react/README.md: -------------------------------------------------------------------------------- 1 | # `@isograph/react` 2 | 3 | This package exposes the Isograph runtime for use with regular apps. 4 | 5 | Please see the [quickstart](../../docs-website/docs/quickstart.md) and the [demos](../../demos/), as this package will change significantly going forward. 6 | -------------------------------------------------------------------------------- /libs/isograph-react/isograph.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../isograph-compiler/isograph-config-schema.json", 3 | "project_root": "./src/tests", 4 | "schema": "./schema.graphql", 5 | "options": { 6 | "on_invalid_id_type": "error" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /libs/isograph-react/schema.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | me: Economist! 3 | you: Economist! 4 | node(id: ID!): Node 5 | query: Query! 6 | } 7 | 8 | type Economist implements Node { 9 | id: ID! 10 | name: String! 11 | predecessor: Economist 12 | successor: Economist 13 | } 14 | 15 | interface Node { 16 | id: ID! 17 | } 18 | -------------------------------------------------------------------------------- /libs/isograph-react/src/loadable-hooks/useImperativeExposedMutationField.ts: -------------------------------------------------------------------------------- 1 | export type UseImperativeLoadableFieldReturn = { 2 | loadField: (args: TArgs) => void; 3 | }; 4 | 5 | // Note: this function doesn't seem to work if there are additional arguments, 6 | // e.g. with set_pet_tagline. Why? This seems to straightforwardly call 7 | // exposedField(args)[1](); Odd. 8 | export function useImperativeExposedMutationField( 9 | exposedField: (args: TArgs) => [string, () => void], 10 | ): UseImperativeLoadableFieldReturn { 11 | return { 12 | loadField: (args: TArgs) => { 13 | const [_id, loader] = exposedField(args); 14 | loader(); 15 | }, 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /libs/isograph-react/src/react/RenderAfterCommit__DO_NOT_USE.tsx: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from 'react'; 2 | 3 | /** 4 | * This is a function that will render a component only after it commits. 5 | * It should not be used in production. It's useful as a way to debug issues 6 | * with NextJS, where an indefinite suspense causes the server to hang 7 | * forever and never complete the original request. 8 | */ 9 | export function RenderAfterCommit__DO_NOT_USE({ 10 | children, 11 | }: { 12 | children: React.ReactNode; 13 | }) { 14 | const [show, setShow] = useState(false); 15 | useEffect(() => setShow(true), []); 16 | return show ? children : null; 17 | } 18 | -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/meName/normalization_ast.ts: -------------------------------------------------------------------------------- 1 | import type {NormalizationAst} from '@isograph/react'; 2 | const normalizationAst: NormalizationAst = { 3 | kind: "NormalizationAst", 4 | selections: [ 5 | { 6 | kind: "Linked", 7 | fieldName: "me", 8 | arguments: null, 9 | concreteType: "Economist", 10 | selections: [ 11 | { 12 | kind: "Scalar", 13 | fieldName: "id", 14 | arguments: null, 15 | }, 16 | { 17 | kind: "Scalar", 18 | fieldName: "name", 19 | arguments: null, 20 | }, 21 | ], 22 | }, 23 | ], 24 | }; 25 | export default normalizationAst; 26 | -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/meName/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { meNameField as resolver } from '../../../garbageCollection.test'; 3 | export type Query__meName__output_type = ReturnType; -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/meName/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type Query__meName__param = { 3 | readonly data: { 4 | readonly me: { 5 | readonly name: string, 6 | }, 7 | }, 8 | readonly parameters: Record, 9 | }; 10 | -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/meName/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query meName {\ 2 | me {\ 3 | id,\ 4 | name,\ 5 | },\ 6 | }'; -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/meNameSuccessor/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { meNameField as resolver } from '../../../meNameSuccessor'; 3 | export type Query__meNameSuccessor__output_type = ReturnType; -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/meNameSuccessor/param_type.ts: -------------------------------------------------------------------------------- 1 | 2 | export type Query__meNameSuccessor__param = { 3 | readonly data: { 4 | readonly me: { 5 | readonly name: string, 6 | readonly successor: ({ 7 | readonly successor: ({ 8 | readonly name: string, 9 | } | null), 10 | } | null), 11 | }, 12 | }, 13 | readonly parameters: Record, 14 | }; 15 | -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/meNameSuccessor/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query meNameSuccessor {\ 2 | me {\ 3 | id,\ 4 | name,\ 5 | successor {\ 6 | id,\ 7 | successor {\ 8 | id,\ 9 | name,\ 10 | },\ 11 | },\ 12 | },\ 13 | }'; -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/nodeField/normalization_ast.ts: -------------------------------------------------------------------------------- 1 | import type {NormalizationAst} from '@isograph/react'; 2 | const normalizationAst: NormalizationAst = { 3 | kind: "NormalizationAst", 4 | selections: [ 5 | { 6 | kind: "Linked", 7 | fieldName: "node", 8 | arguments: [ 9 | [ 10 | "id", 11 | { kind: "Variable", name: "id" }, 12 | ], 13 | ], 14 | concreteType: null, 15 | selections: [ 16 | { 17 | kind: "Scalar", 18 | fieldName: "__typename", 19 | arguments: null, 20 | }, 21 | { 22 | kind: "Scalar", 23 | fieldName: "id", 24 | arguments: null, 25 | }, 26 | ], 27 | }, 28 | ], 29 | }; 30 | export default normalizationAst; 31 | -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/nodeField/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { nodeField as resolver } from '../../../nodeQuery'; 3 | export type Query__nodeField__output_type = ReturnType; -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/nodeField/param_type.ts: -------------------------------------------------------------------------------- 1 | import type { Query__nodeField__parameters } from './parameters_type'; 2 | 3 | export type Query__nodeField__param = { 4 | readonly data: { 5 | readonly node: ({ 6 | readonly id: string, 7 | } | null), 8 | }, 9 | readonly parameters: Query__nodeField__parameters, 10 | }; 11 | -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/nodeField/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Query__nodeField__parameters = { 2 | readonly id: string, 3 | }; 4 | -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/nodeField/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query nodeField($id: ID!) {\ 2 | node____id___v_id: node(id: $id) {\ 3 | __typename,\ 4 | id,\ 5 | },\ 6 | }'; -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/subquery/output_type.ts: -------------------------------------------------------------------------------- 1 | import type React from 'react'; 2 | import { subquery as resolver } from '../../../normalizeData.test'; 3 | export type Query__subquery__output_type = ReturnType; -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/subquery/param_type.ts: -------------------------------------------------------------------------------- 1 | import type { Query__subquery__parameters } from './parameters_type'; 2 | 3 | export type Query__subquery__param = { 4 | readonly data: { 5 | readonly query: { 6 | readonly node: ({ 7 | readonly id: string, 8 | } | null), 9 | }, 10 | }, 11 | readonly parameters: Query__subquery__parameters, 12 | }; 13 | -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/subquery/parameters_type.ts: -------------------------------------------------------------------------------- 1 | export type Query__subquery__parameters = { 2 | readonly id: string, 3 | }; 4 | -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/__isograph/Query/subquery/query_text.ts: -------------------------------------------------------------------------------- 1 | export default 'query subquery($id: ID!) {\ 2 | query {\ 3 | node____id___v_id: node(id: $id) {\ 4 | __typename,\ 5 | id,\ 6 | },\ 7 | },\ 8 | }'; -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/meNameSuccessor.ts: -------------------------------------------------------------------------------- 1 | import { ROOT_ID } from '../core/IsographEnvironment'; 2 | import { iso } from './__isograph/iso'; 3 | 4 | export const meNameField = iso(` 5 | field Query.meNameSuccessor { 6 | me { 7 | name 8 | successor { 9 | successor { 10 | name 11 | } 12 | } 13 | } 14 | } 15 | `)(() => {}); 16 | const meNameSuccessorEntrypoint = iso(`entrypoint Query.meNameSuccessor`); 17 | export const meNameSuccessorRetainedQuery = { 18 | normalizationAst: 19 | meNameSuccessorEntrypoint.networkRequestInfo.normalizationAst.selections, 20 | variables: {}, 21 | root: { 22 | __link: ROOT_ID, 23 | __typename: 'Query', 24 | }, 25 | }; 26 | -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/nodeQuery.ts: -------------------------------------------------------------------------------- 1 | import { RetainedQuery } from '../core/garbageCollection'; 2 | import { ROOT_ID } from '../core/IsographEnvironment'; 3 | import { iso } from './__isograph/iso'; 4 | 5 | // TODO investigate why this can't be in garbageCollection.test.ts without 6 | // typescript incorrectly thinking it is referenced in its own initializer 7 | export const nodeField = iso(` 8 | field Query.nodeField($id: ID!) { 9 | node(id: $id) { 10 | id 11 | } 12 | } 13 | `)(() => {}); 14 | const nodeFieldEntrypoint = iso(`entrypoint Query.nodeField`); 15 | export const nodeFieldRetainedQuery: RetainedQuery = { 16 | normalizationAst: 17 | nodeFieldEntrypoint.networkRequestInfo.normalizationAst.selections, 18 | variables: { id: 0 }, 19 | root: { __link: ROOT_ID, __typename: 'Query' }, 20 | }; 21 | -------------------------------------------------------------------------------- /libs/isograph-react/src/tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "allowImportingTsExtensions": true, 17 | "paths": { 18 | "@isograph/react": ["../index.ts"] 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /libs/isograph-react/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.pkg.json", 3 | "compilerOptions": { 4 | "noEmit": true 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /libs/isograph-react/tsconfig.pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/", 5 | "rootDir": "./src/", 6 | "declaration": true, 7 | "jsx": "react" 8 | }, 9 | "include": ["./**/*.ts", "./**/*.tsx"], 10 | "exclude": [ 11 | "./src/tests/**/*", 12 | "./vitest.config.ts", 13 | "**/node_modules", 14 | "**/dist" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /libs/isograph-react/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import babel from 'vite-plugin-babel'; 2 | import commonjs from 'vite-plugin-commonjs'; 3 | import { defineProject } from 'vitest/config'; 4 | 5 | export default defineProject({ 6 | plugins: [ 7 | babel({ 8 | filter: /\.[jt]sx?$/, 9 | babelConfig: { 10 | presets: ['@babel/preset-typescript'], 11 | plugins: [require('../isograph-babel-plugin/BabelPluginIsograph')], 12 | }, 13 | }), 14 | commonjs({ 15 | advanced: { 16 | importRules: 'merge', 17 | }, 18 | }), 19 | ], 20 | }); 21 | -------------------------------------------------------------------------------- /libs/isograph-reference-counted-pointer/README.md: -------------------------------------------------------------------------------- 1 | # Reference counted pointers 2 | 3 | ## API 4 | 5 | ```js 6 | 7 | ``` 8 | -------------------------------------------------------------------------------- /libs/isograph-reference-counted-pointer/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './createReferenceCountedPointer'; 2 | -------------------------------------------------------------------------------- /libs/isograph-reference-counted-pointer/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.pkg.json", 3 | "compilerOptions": { 4 | "noEmit": true 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /libs/isograph-reference-counted-pointer/tsconfig.pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/", 5 | "rootDir": "./src/", 6 | "declaration": true 7 | }, 8 | "include": ["./src/**/*.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'libs/*' 3 | - 'demos/*' 4 | - 'docs-website' 5 | -------------------------------------------------------------------------------- /relay-crates/common/Cargo.toml: -------------------------------------------------------------------------------- 1 | # @generated by autocargo from //relay/oss/crates/common:common 2 | 3 | [package] 4 | name = "common" 5 | version = "0.0.0" 6 | authors = ["Facebook"] 7 | edition = "2021" 8 | repository = "https://github.com/facebook/relay" 9 | license = "MIT" 10 | 11 | [dependencies] 12 | colored = "2.1.0" 13 | indexmap = { version = "2.1.0", features = ["arbitrary", "rayon", "serde"] } 14 | intern = { path = "../intern" } 15 | log = { version = "0.4.17", features = ["kv_unstable", "kv_unstable_std"] } 16 | lsp-types = "0.94.1" 17 | md-5 = "0.10" 18 | rayon = "1.2" 19 | serde = { version = "1.0.185", features = ["derive", "rc"] } 20 | serde_json = { version = "1.0.100", features = ["float_roundtrip", "unbounded_depth"] } 21 | typetag = "0.2.15" 22 | -------------------------------------------------------------------------------- /relay-crates/fixture-tests/Cargo.toml: -------------------------------------------------------------------------------- 1 | # @generated by autocargo from //relay/oss/crates/fixture-tests:[fixture-tests,fixture-tests-bin,fixture-tests-tests] 2 | 3 | [package] 4 | name = "fixture-tests" 5 | version = "0.0.0" 6 | authors = ["Facebook"] 7 | edition = "2021" 8 | repository = "https://github.com/facebook/relay" 9 | license = "MIT" 10 | 11 | [[bin]] 12 | name = "fixture_tests_bin" 13 | path = "src/main.rs" 14 | 15 | [[test]] 16 | name = "fixture_tests_tests" 17 | path = "tests/uppercase_test.rs" 18 | 19 | [dependencies] 20 | clap = { version = "3.2.25", features = ["derive", "env", "regex", "unicode", "wrap_help"] } 21 | colored = "2.1.0" 22 | diff = "0.1" 23 | lazy_static = "1.4" 24 | signedsource = { path = "../signedsource" } 25 | tokio = { version = "1.29.1", features = ["full", "test-util", "tracing"] } 26 | -------------------------------------------------------------------------------- /relay-crates/fixture-tests/tests/uppercase/fixtures/hello.expected: -------------------------------------------------------------------------------- 1 | ==================================== INPUT ==================================== 2 | Hello 3 | ==================================== OUTPUT =================================== 4 | HELLO 5 | -------------------------------------------------------------------------------- /relay-crates/fixture-tests/tests/uppercase/fixtures/hello.txt: -------------------------------------------------------------------------------- 1 | Hello 2 | -------------------------------------------------------------------------------- /relay-crates/fixture-tests/tests/uppercase/fixtures/world.expected: -------------------------------------------------------------------------------- 1 | ==================================== INPUT ==================================== 2 | world 3 | ==================================== OUTPUT =================================== 4 | WORLD 5 | -------------------------------------------------------------------------------- /relay-crates/fixture-tests/tests/uppercase/fixtures/world.txt: -------------------------------------------------------------------------------- 1 | world 2 | -------------------------------------------------------------------------------- /relay-crates/fixture-tests/tests/uppercase/mod.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | use fixture_tests::Fixture; 9 | 10 | pub async fn transform_fixture(fixture: &Fixture<'_>) -> Result { 11 | Ok(fixture.content.to_uppercase()) 12 | } 13 | -------------------------------------------------------------------------------- /relay-crates/graphql-cli/Cargo.toml: -------------------------------------------------------------------------------- 1 | # @generated by autocargo from //relay/oss/crates/graphql-cli:graphql-cli 2 | 3 | [package] 4 | name = "graphql-cli" 5 | version = "0.0.0" 6 | authors = ["Facebook"] 7 | edition = "2021" 8 | repository = "https://github.com/facebook/relay" 9 | license = "MIT" 10 | 11 | [dependencies] 12 | colored = "2.1.0" 13 | common = { path = "../common" } 14 | -------------------------------------------------------------------------------- /relay-crates/graphql-cli/src/lib.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | #![allow(clippy::all)] 8 | 9 | mod diagnostic_printer; 10 | mod source_printer; 11 | mod text_style; 12 | 13 | pub use diagnostic_printer::DiagnosticPrinter; 14 | pub use diagnostic_printer::Sources; 15 | pub use source_printer::SourcePrinter; 16 | pub use text_style::Style; 17 | pub use text_style::Styles; 18 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/README.md: -------------------------------------------------------------------------------- 1 | # graphql_syntax 2 | 3 | Lexer, parser, and CST (concrete syntax tree) for the executable subset of GraphQL syntax. 4 | 5 | ## Development 6 | 7 | Note that snapshots can be updated by running tests with the `UPDATE_SNAPSHOTS=1` environment variable set. 8 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/src/node/directive.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | use common::Named; 9 | use common::Span; 10 | use intern::string_key::StringKey; 11 | 12 | use super::primitive::*; 13 | use super::value::Argument; 14 | 15 | #[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] 16 | pub struct Directive { 17 | pub span: Span, 18 | pub at: Token, 19 | pub name: Identifier, 20 | pub arguments: Option>, 21 | } 22 | 23 | impl Named for Directive { 24 | type Name = StringKey; 25 | fn name(&self) -> StringKey { 26 | self.name.value 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/src/node/mod.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | mod constant_directive; 9 | mod constant_value; 10 | mod directive; 11 | mod document; 12 | mod executable; 13 | mod primitive; 14 | mod type_annotation; 15 | mod type_system; 16 | mod value; 17 | 18 | pub use constant_directive::*; 19 | pub use constant_value::*; 20 | pub use directive::*; 21 | pub use document::*; 22 | pub use executable::*; 23 | pub use primitive::*; 24 | pub use type_annotation::*; 25 | pub use type_system::*; 26 | pub use value::*; 27 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_document/fixtures/invalid_definition.invalid.expected: -------------------------------------------------------------------------------- 1 | ==================================== INPUT ==================================== 2 | # expected-to-throw 3 | 4 | fragment F on User { 5 | __typename 6 | } 7 | 8 | foobar 9 | ==================================== ERROR ==================================== 10 | ✖︎ Expected a end of file 11 | 12 | invalid_definition.invalid.graphql:7:1 13 | 5 │ } 14 | 6 │ 15 | 7 │ foobar 16 | │ ^^^^^^ 17 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_document/fixtures/invalid_definition.invalid.graphql: -------------------------------------------------------------------------------- 1 | # expected-to-throw 2 | 3 | fragment F on User { 4 | __typename 5 | } 6 | 7 | foobar 8 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_document/fixtures/mixed.graphql: -------------------------------------------------------------------------------- 1 | scalar Foo 2 | 3 | """ 4 | Definition with comment 5 | """ 6 | type User { 7 | id: ID! 8 | } 9 | 10 | fragment F on User { 11 | id 12 | } 13 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_document_with_features/fixtures/fragment_with_empty_vardefs.invalid.expected: -------------------------------------------------------------------------------- 1 | ==================================== INPUT ==================================== 2 | # expected-to-throw 3 | fragment Test() on User { 4 | ...Bar 5 | } 6 | ==================================== ERROR ==================================== 7 | ✖︎ Expected the list to be non-empty 8 | 9 | fragment_with_empty_vardefs.invalid.graphql:2:14 10 | 1 │ # expected-to-throw 11 | 2 │ fragment Test() on User { 12 | │ ^^ 13 | 3 │ ...Bar 14 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_document_with_features/fixtures/fragment_with_empty_vardefs.invalid.graphql: -------------------------------------------------------------------------------- 1 | # expected-to-throw 2 | fragment Test() on User { 3 | ...Bar 4 | } 5 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_document_with_features/fixtures/fragment_with_variable_defs.graphql: -------------------------------------------------------------------------------- 1 | fragment Test($x: Int = 3) on User { 2 | ...Bar 3 | } 4 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_document_with_features/fixtures/spread_with_arguments.graphql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | ...Bar(x: $x) 3 | } 4 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_document_with_features/fixtures/spread_with_empty_arguments.invalid.expected: -------------------------------------------------------------------------------- 1 | ==================================== INPUT ==================================== 2 | # expected-to-throw 3 | fragment Test on User { 4 | ...Bar() 5 | } 6 | ==================================== ERROR ==================================== 7 | ✖︎ Expected an argument 8 | 9 | spread_with_empty_arguments.invalid.graphql:3:9 10 | 2 │ fragment Test on User { 11 | 3 │ ...Bar() 12 | │ ^^ 13 | 4 │ } 14 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_document_with_features/fixtures/spread_with_empty_arguments.invalid.graphql: -------------------------------------------------------------------------------- 1 | # expected-to-throw 2 | fragment Test on User { 3 | ...Bar() 4 | } 5 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/fragment_with_variable_defs.invalid.expected: -------------------------------------------------------------------------------- 1 | ==================================== INPUT ==================================== 2 | # expected-to-throw 3 | fragment Test($x: Int = 3) on User { 4 | ...Bar 5 | } 6 | ==================================== ERROR ==================================== 7 | ✖︎ Expected a non-variable identifier (e.g. 'x' or 'Foo') 8 | 9 | fragment_with_variable_defs.invalid.graphql:2:14 10 | 1 │ # expected-to-throw 11 | 2 │ fragment Test($x: Int = 3) on User { 12 | │ ^ 13 | 3 │ ...Bar 14 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/fragment_with_variable_defs.invalid.graphql: -------------------------------------------------------------------------------- 1 | # expected-to-throw 2 | fragment Test($x: Int = 3) on User { 3 | ...Bar 4 | } 5 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/incomplete_field_alias.expected: -------------------------------------------------------------------------------- 1 | ==================================== INPUT ==================================== 2 | # expected-to-throw 3 | { 4 | foo: 5 | } 6 | ==================================== ERROR ==================================== 7 | ✖︎ Incomplete field alias, expected non-variable identifier (e.g. 'x' or 'Foo') but found closing brace ('}') 8 | 9 | incomplete_field_alias.graphql:3:3 10 | 2 │ { 11 | 3 │ foo: 12 | │ ^^^^ 13 | 4 │ } 14 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/incomplete_field_alias.graphql: -------------------------------------------------------------------------------- 1 | # expected-to-throw 2 | { 3 | foo: 4 | } 5 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/incorrect_variable_name.invalid.expected: -------------------------------------------------------------------------------- 1 | ==================================== INPUT ==================================== 2 | # expected-to-throw 3 | { 4 | image(size: $100) 5 | } 6 | ==================================== ERROR ==================================== 7 | ✖︎ Expected a valid variable name after $ (alphabetic character followed by any number of alphabetic, number and _ characters) 8 | 9 | incorrect_variable_name.invalid.graphql:3:18 10 | 2 │ { 11 | 3 │ image(size: $100) 12 | │ ^^^ 13 | 4 │ } 14 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/incorrect_variable_name.invalid.graphql: -------------------------------------------------------------------------------- 1 | # expected-to-throw 2 | { 3 | image(size: $100) 4 | } 5 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/invalid_number.expected: -------------------------------------------------------------------------------- 1 | ==================================== INPUT ==================================== 2 | # expected-to-throw 3 | query TestQuery { 4 | friends(first: 1.23.4) { 5 | count 6 | } 7 | } 8 | ==================================== ERROR ==================================== 9 | ✖︎ Invalid number value, expected an int or float 10 | 11 | invalid_number.graphql:3:20 12 | 2 │ query TestQuery { 13 | 3 │ friends(first: 1.23.4) { 14 | │ ^^^^^ 15 | 4 │ count 16 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/invalid_number.graphql: -------------------------------------------------------------------------------- 1 | # expected-to-throw 2 | query TestQuery { 3 | friends(first: 1.23.4) { 4 | count 5 | } 6 | } -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/keyword_as_name.graphql: -------------------------------------------------------------------------------- 1 | query KeywordAsName { 2 | search_results(query: "test") 3 | } 4 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/list_of_enum.graphql: -------------------------------------------------------------------------------- 1 | fragment TestFrag on MyType { 2 | issues(orderby: [LAST_UPDATED]) 3 | } 4 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/missing_zero_on_float.invalid.expected: -------------------------------------------------------------------------------- 1 | ==================================== INPUT ==================================== 2 | # expected-to-throw 3 | { 4 | friends( 5 | arg: .5 6 | ) { 7 | count 8 | } 9 | } 10 | ==================================== ERROR ==================================== 11 | ✖︎ Invalid float literal, fractional float literals require a leading 0, e.g. 0.5 instead of .5 12 | 13 | missing_zero_on_float.invalid.graphql:4:14 14 | 3 │ friends( 15 | 4 │ arg: .5 16 | │ ^^ 17 | 5 │ ) { 18 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/missing_zero_on_float.invalid.graphql: -------------------------------------------------------------------------------- 1 | # expected-to-throw 2 | { 3 | friends( 4 | arg: .5 5 | ) { 6 | count 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/multiple_parse_errors.invalid.graphql: -------------------------------------------------------------------------------- 1 | # expected-to-throw 2 | query Test( 3 | %%%% # unexpected % signs 4 | $arg: String, 5 | width: Int # missing $ 6 | height: Int # missing $ 7 | ) { 8 | __typename 9 | } 10 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/space_in_variable.graphql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | photo(size: $ 3 | # comment between $ and variable identifier 4 | photoSize 5 | ) 6 | } 7 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/spread_with_arguments.invalid.expected: -------------------------------------------------------------------------------- 1 | ==================================== INPUT ==================================== 2 | # expected-to-throw 3 | fragment Test on User { 4 | ...Bar(x: $x) 5 | ...Foo() 6 | } 7 | ==================================== ERROR ==================================== 8 | ✖︎ Expected a selection: field, inline fragment, or fragment spread 9 | 10 | spread_with_arguments.invalid.graphql:3:9 11 | 2 │ fragment Test on User { 12 | 3 │ ...Bar(x: $x) 13 | │ ^ 14 | 4 │ ...Foo() 15 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/spread_with_arguments.invalid.graphql: -------------------------------------------------------------------------------- 1 | # expected-to-throw 2 | fragment Test on User { 3 | ...Bar(x: $x) 4 | ...Foo() 5 | } 6 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/unterminated_string.invalid.expected: -------------------------------------------------------------------------------- 1 | ==================================== INPUT ==================================== 2 | # expected-to-throw 3 | { 4 | friends( 5 | arg: "unterminated string 6 | ) { 7 | count 8 | } 9 | } 10 | ==================================== ERROR ==================================== 11 | ✖︎ Unterminated string literal (strings cannot contain unescaped line breaks) 12 | 13 | unterminated_string.invalid.graphql:4:14 14 | 3 │ friends( 15 | 4 │ arg: "unterminated string 16 | │ ^^^^^^^^^^^^^^^^^^^^ 17 | 5 │ ) { 18 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document/fixtures/unterminated_string.invalid.graphql: -------------------------------------------------------------------------------- 1 | # expected-to-throw 2 | { 3 | friends( 4 | arg: "unterminated string 5 | ) { 6 | count 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/argument-missing-identifier-2.grahql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | photo(s: 42, : $size) 3 | } 4 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/argument-missing-identifier.graphql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | photo(: $size) 3 | } 4 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/argument-missing-value-2.graphql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | photo( 3 | s: 4 | size1: $size 5 | size2: $size 6 | ) 7 | } 8 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/argument-missing-value.graphql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | photo(size:) 3 | } 4 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/argument-name-only-2.graphql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | photo( 3 | s 4 | size: $size 5 | ) 6 | } 7 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/argument-name-only.graphql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | photo(size) 3 | } 4 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/argument-value-only-2.graphql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | photo(s: 42, $size) 3 | } 4 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/argument-value-only-3.grahql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | photo(h: 42, 12, scale: 2.0) 3 | } 4 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/argument-value-only.graphql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | photo($size) 3 | } 4 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/argument-without-closing-paren.graphql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | photo (size: $size { 3 | url 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/directive-without-name.graphql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | photo @ 3 | } 4 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/empty-argument-list.graphql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | photo() 3 | } 4 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/empty-linked-field.graphql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | user { 3 | } 4 | } 5 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/inline-fragment-without-selection.graphql: -------------------------------------------------------------------------------- 1 | fragment Test on User { 2 | ... on User 3 | username 4 | } 5 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/type-in-argument-value.graphql: -------------------------------------------------------------------------------- 1 | query Test @test(: ID!) { 2 | node { 3 | __typename 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_executable_document_with_error_recovery/fixtures/variable-definition-with-directive.graphql: -------------------------------------------------------------------------------- 1 | mutation Mutation( 2 | $variable: ID = null @some_directive 3 | ) { 4 | field 5 | } 6 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_schema_document/fixtures/directive_description.graphql: -------------------------------------------------------------------------------- 1 | """ 2 | My Directive 3 | """ 4 | directive @my_directive on FIELD 5 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_schema_document/fixtures/field_description.graphql: -------------------------------------------------------------------------------- 1 | type Foo { 2 | "Single line field description" 3 | line: String 4 | """ 5 | Block field description 6 | """ 7 | block: String 8 | """ 9 | Multiline block field description which is so long 10 | that it spans onto a second line. 11 | """ 12 | multiline_block: String 13 | } 14 | 15 | extend type Foo { 16 | "Single line extended field description" 17 | extended_line: String 18 | """ 19 | Block field description 20 | """ 21 | extended_block: String 22 | """ 23 | Multiline block field description which is so long 24 | that it spans onto a second line. 25 | """ 26 | extended_multiline_block: String 27 | } 28 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_schema_document/fixtures/schema_with_leading_comment.graphql: -------------------------------------------------------------------------------- 1 | """Description of the schema as per https://github.com/graphql/graphql-spec/pull/466""" 2 | schema { 3 | query: RootQueryType 4 | mutation: RootMutationType 5 | } 6 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/parse_schema_document/fixtures/type_definition.graphql: -------------------------------------------------------------------------------- 1 | type Basic 2 | 3 | type Photo { 4 | url: String 5 | } 6 | 7 | type User implements Actor & Node @strong(field_name: "id") { 8 | id: ID! 9 | name(language: Language): String! 10 | } 11 | 12 | type OnlyInterfaces implements 13 | & Actor 14 | & Node 15 | -------------------------------------------------------------------------------- /relay-crates/graphql-syntax/tests/print_test.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | * 7 | * @generated SignedSource<> 8 | */ 9 | 10 | mod print; 11 | 12 | use fixture_tests::test_fixture; 13 | use print::transform_fixture; 14 | 15 | #[tokio::test] 16 | async fn schema() { 17 | let input = include_str!("print/fixtures/schema.graphql"); 18 | let expected = include_str!("print/fixtures/schema.expected"); 19 | test_fixture( 20 | transform_fixture, 21 | file!(), 22 | "schema.graphql", 23 | "print/fixtures/schema.expected", 24 | input, 25 | expected, 26 | ) 27 | .await; 28 | } 29 | -------------------------------------------------------------------------------- /relay-crates/signedsource/Cargo.toml: -------------------------------------------------------------------------------- 1 | # @generated by autocargo from //relay/oss/crates/signedsource:signedsource 2 | 3 | [package] 4 | name = "signedsource" 5 | version = "0.0.0" 6 | authors = ["Facebook"] 7 | edition = "2021" 8 | repository = "https://github.com/facebook/relay" 9 | license = "MIT" 10 | 11 | [dependencies] 12 | hex = "0.4.3" 13 | lazy_static = "1.4" 14 | md-5 = "0.10" 15 | regex = "1.9.2" 16 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | edition = "2021" 2 | # group_imports = "StdExternalCrate" 3 | # imports_granularity = "Item" 4 | merge_derives = true 5 | use_field_init_shorthand = true 6 | newline_style = "Unix" 7 | # version = "Two" 8 | -------------------------------------------------------------------------------- /scripts/check-git-status.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [ -z "$(git status --porcelain)" ]; then 6 | # Working directory clean 7 | exit 0 8 | else 9 | echo "Detected changes in the working directory:" 10 | git status 11 | git --no-pager diff --stat 12 | git --no-pager diff 13 | exit 1 14 | fi -------------------------------------------------------------------------------- /scripts/sanity-check.sh: -------------------------------------------------------------------------------- 1 | pnpm format && \ 2 | cargo clippy && \ 3 | pnpm build-demos && \ 4 | ./scripts/check-git-status.sh && \ 5 | pnpm compile-libs && \ 6 | pnpm test 7 | if [ $? -eq 0 ]; then 8 | echo OK 9 | else 10 | echo FAIL 11 | fi 12 | -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["**/*.test.ts", "**/*.stub.ts", "**/node_modules", "**/dist"], 3 | "compilerOptions": { 4 | "target": "ES2015", 5 | "module": "commonjs", 6 | "strict": true, 7 | "esModuleInterop": true, 8 | "lib": ["dom", "dom.iterable", "esnext"], 9 | "skipLibCheck": true, 10 | "jsx": "react", 11 | "forceConsistentCasingInFileNames": true, 12 | "declaration": true, 13 | "declarationMap": true, 14 | "noUnusedLocals": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "noPropertyAccessFromIndexSignature": true, 17 | "noUnusedParameters": true, 18 | "exactOptionalPropertyTypes": true, 19 | "noUncheckedIndexedAccess": true, 20 | "paths": { 21 | "@isograph/*": ["./libs/*"] 22 | }, 23 | "allowUnreachableCode": false 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "./" 5 | }, 6 | "include": [ 7 | "./libs/**/*.ts", 8 | "libs/isograph-react/src/index.tsx", 9 | "libs/isograph-react/src/cache.tsx" 10 | ], 11 | "exclude": ["**/dist"] 12 | } 13 | -------------------------------------------------------------------------------- /turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://turbo.build/schema.json", 3 | "tasks": { 4 | "compile-libs": { 5 | "dependsOn": ["^compile-libs"], 6 | "outputs": ["dist/**"] 7 | }, 8 | "//#build": { 9 | "inputs": ["crates/**", "relay-crates/**", "Cargo.*"], 10 | "outputs": ["**/release/isograph_cli*", "**/debug/isograph_cli*"] 11 | }, 12 | "//#cross": { 13 | "inputs": ["crates/**", "relay-crates/**", "Cargo.*"], 14 | "outputs": ["**/release/isograph_cli*", "**/debug/isograph_cli*"] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vitest.workspace.ts: -------------------------------------------------------------------------------- 1 | export default ['libs/*', 'demos/*', 'docs-website']; 2 | -------------------------------------------------------------------------------- /vscode-extension/.gitignore: -------------------------------------------------------------------------------- 1 | out/ 2 | tsconfig.tsbuildinfo 3 | *.vsix 4 | -------------------------------------------------------------------------------- /vscode-extension/.prettierignore: -------------------------------------------------------------------------------- 1 | out/** 2 | **.vsix 3 | -------------------------------------------------------------------------------- /vscode-extension/src/config.ts: -------------------------------------------------------------------------------- 1 | import { ConfigurationScope, workspace } from 'vscode'; 2 | 3 | export type Config = { 4 | rootDirectory: string | null; 5 | pathToIsograph: string | null; 6 | pathToConfig: string | null; 7 | }; 8 | 9 | export function getConfig(scope?: ConfigurationScope): Config { 10 | const configuration = workspace.getConfiguration('isograph', scope); 11 | return { 12 | rootDirectory: configuration.rootDirectory, 13 | pathToIsograph: configuration.pathToIsograph, 14 | pathToConfig: configuration.pathToConfig, 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /vscode-extension/src/context.ts: -------------------------------------------------------------------------------- 1 | import { ExtensionContext, OutputChannel, Terminal } from 'vscode'; 2 | import { LanguageClient } from 'vscode-languageclient/node'; 3 | 4 | export type IsographExtensionContext = { 5 | client: LanguageClient | null; 6 | lspOutputChannel: OutputChannel; 7 | extensionContext: ExtensionContext; 8 | primaryOutputChannel: OutputChannel; 9 | compilerTerminal: Terminal | null; 10 | isographBinaryExecutionOptions: { 11 | rootPath: string; 12 | binaryPath: string; 13 | binaryVersion?: string; 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /vscode-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es2020", 5 | "lib": ["es2020"], 6 | "outDir": "out", 7 | "rootDir": "src", 8 | "sourceMap": false, 9 | "incremental": true, 10 | "strict": true 11 | }, 12 | "include": ["src"], 13 | "exclude": ["node_modules"] 14 | } 15 | --------------------------------------------------------------------------------