├── tests
├── server
│ └── config
│ │ ├── example-nokey.key
│ │ ├── server-start.graphql
│ │ ├── example-ec.key
│ │ ├── server-start-http2-ec.graphql
│ │ ├── server-start-http2-nokey.graphql
│ │ ├── server-start-http2-pkcs8.graphql
│ │ └── server-start-http2-rsa.graphql
├── telemetry
│ └── mod.rs
├── core
│ ├── mod.rs
│ └── snapshots
│ │ ├── auth.md_client.snap
│ │ ├── auth_order.md_client.snap
│ │ ├── test-expr.md_client.snap
│ │ ├── test-query.md_client.snap
│ │ ├── apollo-tracing.md_client.snap
│ │ ├── cors-allow-cred-false.md_client.snap
│ │ ├── cors-allow-cred-true.md_client.snap
│ │ ├── cors-allow-cred-vary.md_client.snap
│ │ ├── custom-headers.md_client.snap
│ │ ├── test-http-headers.md_client.snap
│ │ ├── test-server-vars.md_client.snap
│ │ ├── test-upstream.md_client.snap
│ │ ├── inline-index-list.md_client.snap
│ │ ├── omit-index-list.md_client.snap
│ │ ├── test-http-baseurl.md_client.snap
│ │ ├── test-custom-scalar.md_client.snap
│ │ ├── test-js-request-response-2.md_client.snap
│ │ ├── test-js-request-response.md_client.snap
│ │ ├── test-omit.md_client.snap
│ │ ├── test-inline.md_client.snap
│ │ ├── test-js-multi-onRequest-handlers.md_client.snap
│ │ ├── test-omit-list.md_client.snap
│ │ ├── test-inline-list.md_client.snap
│ │ ├── inline-field.md_client.snap
│ │ ├── modified-field.md_client.snap
│ │ ├── test-enum-aliases.md_client.snap
│ │ ├── test-query-documentation.md_client.snap
│ │ ├── batching.md_client.snap
│ │ ├── resolved-by-parent.md_client.snap
│ │ ├── test-enum.md_client.snap
│ │ ├── test-grpc-proto-path.md_error.snap
│ │ ├── test-list-args.md_client.snap
│ │ ├── test-modify.md_client.snap
│ │ ├── upstream-fail-request-with-body.md_client.snap
│ │ ├── with-args.md_client.snap
│ │ ├── omit-resolved-by-parent.md_client.snap
│ │ ├── simple-graphql.md_client.snap
│ │ ├── test-cache.md_client.snap
│ │ ├── test-enum-merge.md_client.snap
│ │ ├── test-http.md_client.snap
│ │ ├── test-merge-input.md_client.snap
│ │ ├── test-merge-right-with-link-config.md_client.snap
│ │ ├── test-missing-schema-query.md_error.snap
│ │ ├── js-directive.md_client.snap
│ │ ├── rename-field.md_client.snap
│ │ ├── resolve-with-vars.md_client.snap
│ │ ├── simple-query.md_client.snap
│ │ ├── auth-multiple.md_client.snap
│ │ ├── cache-control.md_client.snap
│ │ ├── default-value-arg.md_client.snap
│ │ ├── experimental-headers.md_client.snap
│ │ ├── rest-api.md_0.snap
│ │ ├── rest-api.md_client.snap
│ │ ├── routes-param-on-server-directive.md_client.snap
│ │ ├── showcase.md_client.snap
│ │ ├── test-merge-server-sdl.md_client.snap
│ │ ├── upstream-fail-request.md_client.snap
│ │ ├── with-args-url.md_client.snap
│ │ ├── enum-args.md_client.snap
│ │ ├── federation-subgraph-force-disabled.md_0.snap
│ │ ├── federation-subgraph-force-disabled.md_1.snap
│ │ ├── federation-subgraph-force-enabled.md_0.snap
│ │ ├── federation-subgraph-no-entities.md_0.snap
│ │ ├── federation-subgraph-no-entities.md_1.snap
│ │ ├── rest-api-error.md_client.snap
│ │ ├── rest-api-post.md_0.snap
│ │ ├── rest-api-post.md_client.snap
│ │ ├── test-on-response-body.md_client.snap
│ │ ├── test-scalars-validation.md_client.snap
│ │ ├── test-upstream-headers.md_client.snap
│ │ ├── upstream-batching.md_client.snap
│ │ ├── add-field-index-list.md_client.snap
│ │ ├── graphql-datasource-errors.md_client.snap
│ │ ├── graphql-datasource-no-args.md_client.snap
│ │ ├── nullable-arg-query.md_client.snap
│ │ ├── test-add-link-to-empty-config.md_client.snap
│ │ ├── test-null-in-array.md_client.snap
│ │ ├── test-null-in-object.md_client.snap
│ │ ├── graphql-datasource-query-directives.md_client.snap
│ │ ├── request-to-upstream-batching.md_client.snap
│ │ ├── routes-param-on-server-directive.md_1.snap
│ │ ├── test-enum.md_0.snap
│ │ ├── test-enum.md_1.snap
│ │ ├── default-value-arg.md_0.snap
│ │ ├── default-value-arg.md_1.snap
│ │ ├── enum-args.md_0.snap
│ │ ├── federation-subgraph-no-entities.md_client.snap
│ │ ├── inline-many-list.md_client.snap
│ │ ├── introspection-query-with-disabled-introspection.md_0.snap
│ │ ├── test-expr.md_merged.snap
│ │ ├── test-scalars.md_5.snap
│ │ ├── undeclared-type.md_error.snap
│ │ ├── apollo-tracing.md_0.snap
│ │ ├── apollo-tracing.md_merged.snap
│ │ ├── auth-multiple.md_1.snap
│ │ ├── auth-multiple.md_5.snap
│ │ ├── auth-multiple.md_6.snap
│ │ ├── federation-subgraph-force-disabled.md_client.snap
│ │ ├── omit-many.md_client.snap
│ │ ├── test-enum-aliases.md_0.snap
│ │ ├── test-null-in-array.md_0.snap
│ │ ├── test-null-in-object.md_0.snap
│ │ ├── test-params-as-body.md_client.snap
│ │ ├── test-union-optional.md_0.snap
│ │ ├── batching-disabled.md_client.snap
│ │ ├── call-multiple-steps-piping.md_1.snap
│ │ ├── content-type-graphql.md_client.snap
│ │ ├── graphql-conformance-001.md_client.snap
│ │ ├── graphql-conformance-014.md_client.snap
│ │ ├── test-enum-description.md_0.snap
│ │ ├── test-enum-description.md_1.snap
│ │ ├── test-js-multiple-scripts.md_error.snap
│ │ ├── test-merge-invalid.md_error.snap
│ │ ├── add-field-with-composition.md_1.snap
│ │ ├── call-multiple-steps-piping.md_0.snap
│ │ ├── default-value-config.md_client.snap
│ │ ├── graphql-conformance-018.md_client.snap
│ │ ├── graphql-conformance-http-001.md_client.snap
│ │ ├── graphql-conformance-http-005.md_client.snap
│ │ ├── graphql-conformance-http-014.md_client.snap
│ │ ├── omit-index-list.md_0.snap
│ │ ├── test-enum-empty.md_error.snap
│ │ ├── test-grpc-group-by.md_error.snap
│ │ ├── test-lack-resolver.md_error.snap
│ │ ├── test-required-fields.md_11.snap
│ │ ├── test-required-fields.md_19.snap
│ │ ├── test-required-fields.md_5.snap
│ │ ├── test-scalars-validation.md_0.snap
│ │ ├── test-scalars.md_0.snap
│ │ ├── test-scalars.md_1.snap
│ │ ├── test-scalars.md_3.snap
│ │ ├── undeclared-type-no-base-url.md_error.snap
│ │ ├── add-field-index-list.md_0.snap
│ │ ├── add-field-with-composition.md_0.snap
│ │ ├── add-field-with-modify.md_0.snap
│ │ ├── add-field-with-modify.md_1.snap
│ │ ├── async-cache-global.md_client.snap
│ │ ├── caching-collision.md_client.snap
│ │ ├── inline-index-list.md_0.snap
│ │ ├── inline-many.md_client.snap
│ │ ├── recursive-types-no-resolver.md_error.snap
│ │ ├── resolve-with-headers.md_client.snap
│ │ ├── test-grpc-service-method.md_error.snap
│ │ ├── test-no-base-url.md_error.snap
│ │ ├── test-query.md_merged.snap
│ │ ├── test-scalars.md_2.snap
│ │ ├── batching.md_1.snap
│ │ ├── graphql-conformance-nested-lists.md_1.snap
│ │ ├── ref-other.md_client.snap
│ │ ├── test-enum-description.md_client.snap
│ │ ├── test-ref-other.md_client.snap
│ │ ├── test-scalars-builtin.md_3.snap
│ │ ├── test-scalars-builtin.md_6.snap
│ │ ├── test-scalars-builtin.md_7.snap
│ │ ├── test-scalars-builtin.md_8.snap
│ │ ├── test-scalars-builtin.md_9.snap
│ │ ├── test-scalars-integers.md_0.snap
│ │ ├── test-scalars-integers.md_5.snap
│ │ ├── add-field-with-modify.md_client.snap
│ │ ├── caching.md_0.snap
│ │ ├── dedupe_batch_query_execution.md_client.snap
│ │ ├── graphql-conformance-013.md_client.snap
│ │ ├── graphql-conformance-nested-lists-http.md_1.snap
│ │ ├── grpc-json.md_0.snap
│ │ ├── on-response-body-grpc.md_client.snap
│ │ ├── showcase.md_0.snap
│ │ ├── test-interface.md_client.snap
│ │ ├── test-link-support.md_client.snap
│ │ ├── test-scalars-builtin.md_0.snap
│ │ ├── test-scalars-builtin.md_1.snap
│ │ ├── test-scalars-builtin.md_2.snap
│ │ ├── test-scalars-builtin.md_4.snap
│ │ ├── test-scalars-builtin.md_5.snap
│ │ ├── test-scalars-integers.md_1.snap
│ │ ├── test-scalars-integers.md_6.snap
│ │ ├── add-field.md_0.snap
│ │ ├── graphql-conformance-http-013.md_client.snap
│ │ ├── grpc-proto-with-same-package.md_client.snap
│ │ ├── test-interface-result.md_client.snap
│ │ ├── test-missing-mutation-resolver.md_error.snap
│ │ ├── test-scalars-integers.md_2.snap
│ │ ├── test-scalars-integers.md_7.snap
│ │ ├── test-union.md_0.snap
│ │ ├── test-union.md_1.snap
│ │ ├── with-args-url.md_0.snap
│ │ ├── grpc-json.md_1.snap
│ │ ├── mutation-put.md_0.snap
│ │ ├── simple-graphql.md_0.snap
│ │ ├── simple-query.md_0.snap
│ │ ├── test-add-field.md_client.snap
│ │ ├── test-expr-error.md_error.snap
│ │ ├── test-merge-nested.md_client.snap
│ │ ├── env-value.md_client.snap
│ │ ├── grpc-json.md_2.snap
│ │ ├── inline-field.md_0.snap
│ │ ├── js-directive.md_0.snap
│ │ ├── mutation.md_0.snap
│ │ ├── rename-field.md_0.snap
│ │ ├── rename-field.md_1.snap
│ │ ├── test-batch-operator-post.md_error.snap
│ │ ├── test-description-many.md_client.snap
│ │ ├── test-grpc-invalid-proto-id.md_error.snap
│ │ ├── test-invalid-server.md_error.snap
│ │ ├── test-nested-value.md_client.snap
│ │ ├── test-optional-key-skip-empty.md_client.snap
│ │ ├── test-scalars-builtin.md_client.snap
│ │ ├── test-union-ambiguous.md_0.snap
│ │ ├── test-union-ambiguous.md_1.snap
│ │ ├── test-union-ambiguous.md_4.snap
│ │ ├── test-union-fieldtype.md_0.snap
│ │ ├── test-union-fieldtype.md_1.snap
│ │ ├── call-mutation.md_0.snap
│ │ ├── introspection-query-with-disabled-introspection.md_client.snap
│ │ ├── modified-field.md_0.snap
│ │ ├── test-add-field-list.md_client.snap
│ │ ├── test-enum-as-argument.md_client.snap
│ │ ├── test-graphqlsource-no-base-url.md_error.snap
│ │ ├── test-grpc-service.md_error.snap
│ │ ├── test-input-out.md_client.snap
│ │ ├── test-js-request-response.md_0.snap
│ │ ├── test-union-ambiguous.md_5.snap
│ │ ├── call-mutation.md_2.snap
│ │ ├── call-mutation.md_4.snap
│ │ ├── graphql-conformance-003.md_client.snap
│ │ ├── graphql-datasource-query-directives.md_1.snap
│ │ ├── jit-enum-array.md_client.snap
│ │ ├── resolve-with-headers.md_0.snap
│ │ ├── resolved-by-parent.md_0.snap
│ │ ├── test-add-field-error.md_error.snap
│ │ ├── test-custom-scalar.md_merged.snap
│ │ ├── test-discriminator-invalid.md_error.snap
│ │ ├── test-enum-as-argument.md_0.snap
│ │ ├── test-enum.md_merged.snap
│ │ ├── test-expr-with-inline.md_error.snap
│ │ ├── test-grpc-missing-fields.md_error.snap
│ │ ├── test-hostname-faliure.md_error.snap
│ │ ├── test-http-headers.md_merged.snap
│ │ ├── test-inline-error.md_error.snap
│ │ ├── test-upstream.md_merged.snap
│ │ ├── call-mutation.md_3.snap
│ │ ├── graphql-conformance-http-003.md_client.snap
│ │ ├── graphql-conformance-http-004.md_client.snap
│ │ ├── graphql-datasource-with-args.md_0.snap
│ │ ├── omit-resolved-by-parent.md_0.snap
│ │ ├── test-expr-with-add-field.md_error.snap
│ │ ├── test-http-baseurl.md_merged.snap
│ │ ├── test-http-tmpl.md_client.snap
│ │ ├── test-http-with-add-field.md_error.snap
│ │ ├── custom-headers.md_0.snap
│ │ ├── graphql-datasource-mutation.md_0.snap
│ │ ├── test-alias-on-enum.md_client.snap
│ │ ├── test-graphql-with-add-field.md_error.snap
│ │ ├── test-groupby-without-batching.md_error.snap
│ │ ├── test-server-vars.md_merged.snap
│ │ ├── add-field.md_client.snap
│ │ ├── graphql-conformance-014.md_1.snap
│ │ ├── nullable-arg-query.md_1.snap
│ │ ├── related-fields-recursive.md_client.snap
│ │ ├── showcase.md_1.snap
│ │ ├── test-eval-partial.md_client.snap
│ │ ├── test-graphqlsource.md_client.snap
│ │ ├── test-http-with-mustache-expr.md_client.snap
│ │ ├── test-input-out.md_0.snap
│ │ ├── test-multiple-config-types.md_0.snap
│ │ ├── test-multiple-config-types.md_client.snap
│ │ ├── test-on-response-body.md_0.snap
│ │ ├── test-params-as-body.md_0.snap
│ │ ├── test-scalars.md_4.snap
│ │ ├── enum-args.md_merged.snap
│ │ ├── graphql-conformance-http-014.md_1.snap
│ │ ├── showcase.md_2.snap
│ │ ├── test-enum-aliases.md_merged.snap
│ │ ├── test-js-multi-onRequest-handlers.md_0.snap
│ │ ├── test-js-request-response-2.md_0.snap
│ │ ├── test-query-documentation.md_merged.snap
│ │ ├── test-required-fields.md_0.snap
│ │ ├── test-required-fields.md_3.snap
│ │ ├── test-response-headers-name.md_error.snap
│ │ ├── with-args.md_0.snap
│ │ ├── content-type-graphql.md_0.snap
│ │ ├── graphql-conformance-001.md_0.snap
│ │ ├── graphql-conformance-010.md_0.snap
│ │ ├── graphql-conformance-010.md_1.snap
│ │ ├── graphql-conformance-nested-lists.md_client.snap
│ │ ├── ref-other-nested.md_client.snap
│ │ ├── test-response-header-value.md_error.snap
│ │ ├── auth-protected-without-auth.md_error.snap
│ │ └── batching-disabled.md_0.snap
├── execution
│ ├── test-invalid-server.md
│ ├── test-missing-root-types.md
│ ├── test-missing-schema-query.md
│ ├── test-expr.md
│ ├── test-no-base-url.md
│ ├── test-query.md
│ ├── undeclared-type.md
│ ├── test-enum-empty.md
│ ├── auth-protected-without-auth.md
│ ├── undeclared-type-no-base-url.md
│ ├── test-expr-error.md
│ ├── test-http-headers.md
│ ├── test-merge-server-sdl.md
│ ├── test-custom-scalar.md
│ ├── test-http-baseurl.md
│ ├── test-http.md
│ ├── test-query-documentation.md
│ ├── test-modify.md
│ ├── test-missing-query-resolver.md
│ ├── test-upstream.md
│ ├── test-cache.md
│ ├── default-value-config.md
│ ├── experimental-headers-error.md
│ └── test-server-vars.md
├── http
│ └── config
│ │ └── simple.graphql
├── snapshots
│ ├── jit_spec__tests__executor_arguments.snap
│ ├── jit_spec__tests__executor_variables-2.snap
│ ├── jit_spec__tests__executor_variables.snap
│ ├── jit_spec__tests__operation_plan_cache.snap
│ ├── jit_spec__tests__executor_arguments_default_value.snap
│ └── jit_spec__tests__query_alias.snap
└── execution_spec.rs
├── .clippy.toml
├── codecov.yml
├── .gitattributes
├── .prettierignore
├── src
├── core
│ ├── config
│ │ ├── transformer
│ │ │ ├── consolidate_url
│ │ │ │ └── consolidate_url.rs
│ │ │ ├── merge_types
│ │ │ │ ├── mod.rs
│ │ │ │ └── snapshots
│ │ │ │ │ └── tailcall__core__config__transformer__merge_types__type_merger__test__interface_types.snap
│ │ │ ├── snapshots
│ │ │ │ ├── tailcall__core__config__transformer__subgraph__tests__extractor__extract_call.snap
│ │ │ │ ├── tailcall__core__config__transformer__subgraph__tests__extractor__extract_expr.snap
│ │ │ │ ├── tailcall__core__config__transformer__subgraph__tests__extractor__extract_graphql.snap
│ │ │ │ ├── tailcall__core__config__transformer__subgraph__tests__extractor__extract_grpc.snap
│ │ │ │ ├── tailcall__core__config__transformer__subgraph__tests__extractor__extract_http.snap
│ │ │ │ └── tailcall__core__config__transformer__nested_unions__tests__nested_unions_recursive.snap
│ │ │ └── fixtures
│ │ │ │ ├── union.graphql
│ │ │ │ └── recursive-input.graphql
│ │ ├── npo
│ │ │ ├── mod.rs
│ │ │ ├── snapshots
│ │ │ │ ├── tailcall__core__config__npo__tracker__tests__cycles.snap
│ │ │ │ ├── tailcall__core__config__npo__tracker__tests__batched_resolvers.snap
│ │ │ │ ├── tailcall__core__config__npo__tracker__tests__nested_non_list.snap
│ │ │ │ ├── tailcall__core__config__npo__tracker__tests__resolvers.snap
│ │ │ │ ├── tailcall__core__config__npo__tracker__tests__nested_resolvers_without_resolvers.snap
│ │ │ │ ├── tailcall__core__config__npo__tracker__tests__cycles_with_resolvers.snap
│ │ │ │ ├── tailcall__core__config__npo__tracker__tests__cycles_with_resolver.snap
│ │ │ │ ├── tailcall__core__config__npo__tracker__tests__nested_resolvers.snap
│ │ │ │ ├── tailcall__core__config__npo__tracker__tests__multiple_keys.snap
│ │ │ │ ├── tailcall__core__config__npo__tracker__tests__nested_resolvers_non_list_resolvers.snap
│ │ │ │ ├── tailcall__core__config__npo__tracker__tests__nested_config.snap
│ │ │ │ └── tailcall__core__config__npo__tracker__tests__multiple_type_usage.snap
│ │ │ └── fixtures
│ │ │ │ ├── cycles.graphql
│ │ │ │ ├── nested-non-list.graphql
│ │ │ │ ├── nested-without-resolvers.graphql
│ │ │ │ ├── simple-resolvers.graphql
│ │ │ │ ├── cyclic-resolver.graphql
│ │ │ │ ├── cyclic-resolvers.graphql
│ │ │ │ ├── simple-batch-resolver.graphql
│ │ │ │ ├── nested-resolvers.graphql
│ │ │ │ ├── non-list-resolvers.graphql
│ │ │ │ └── multiple-keys.graphql
│ │ └── config_module
│ │ │ ├── fixtures
│ │ │ ├── types-2.graphql
│ │ │ ├── types-3.graphql
│ │ │ ├── enums-2.graphql
│ │ │ ├── unions-2.graphql
│ │ │ ├── enums-3.graphql
│ │ │ ├── types-1.graphql
│ │ │ ├── unions-1.graphql
│ │ │ ├── enums-1.graphql
│ │ │ └── router.graphql
│ │ │ └── snapshots
│ │ │ ├── tailcall__core__config__config_module__merge__tests__enums_invalid.snap
│ │ │ └── tailcall__core__config__config_module__merge__tests__types_invalid.snap
│ ├── jit
│ │ ├── fixtures
│ │ │ └── mod.rs
│ │ └── synth
│ │ │ └── mod.rs
│ ├── auth
│ │ ├── jwt
│ │ │ └── mod.rs
│ │ ├── mod.rs
│ │ └── error.rs
│ ├── proto_reader
│ │ ├── mod.rs
│ │ └── fixtures
│ │ │ └── response_b64.txt
│ ├── cache
│ │ └── mod.rs
│ ├── worker
│ │ └── mod.rs
│ ├── helpers
│ │ └── mod.rs
│ ├── mustache
│ │ └── mod.rs
│ ├── generator
│ │ ├── proto
│ │ │ └── mod.rs
│ │ ├── snapshots
│ │ │ └── tailcall__core__generator__from_proto__test__from_proto_no_service_file.snap
│ │ ├── tests
│ │ │ ├── fixtures
│ │ │ │ └── json
│ │ │ │ │ ├── empty_list.json
│ │ │ │ │ ├── null.json
│ │ │ │ │ ├── boolean.json
│ │ │ │ │ ├── string.json
│ │ │ │ │ ├── number.json
│ │ │ │ │ └── list_primitive_type.json
│ │ │ └── snapshots
│ │ │ │ ├── json_to_config_spec__empty_list.json.snap
│ │ │ │ ├── json_to_config_spec__list_primitive_type.json.snap
│ │ │ │ ├── json_to_config_spec__string.json.snap
│ │ │ │ ├── json_to_config_spec__incompatible_root_object.json.snap
│ │ │ │ ├── json_to_config_spec__list_incompatible_object.json.snap
│ │ │ │ ├── json_to_config_spec__boolean.json.snap
│ │ │ │ └── json_to_config_spec__null.json.snap
│ │ └── json
│ │ │ ├── mod.rs
│ │ │ └── snapshots
│ │ │ └── tailcall__core__generator__json__operation_generator__test__query.snap
│ ├── graphql
│ │ └── mod.rs
│ ├── fixtures
│ │ └── helloworld.graphql
│ ├── http
│ │ └── transformations
│ │ │ └── mod.rs
│ ├── grpc
│ │ └── mod.rs
│ ├── error.rs
│ ├── snapshots
│ │ └── tailcall__core__tests__include_config.snap
│ ├── blueprint
│ │ └── fixture
│ │ │ └── recursive-arg.graphql
│ ├── data_loader
│ │ └── mod.rs
│ ├── has_headers.rs
│ └── rest
│ │ └── mod.rs
├── allocator.rs
├── lib.rs
└── cli
│ ├── tc
│ ├── mod.rs
│ └── gen.rs
│ ├── generator
│ └── mod.rs
│ ├── llm
│ ├── mod.rs
│ ├── error.rs
│ ├── prompts
│ │ └── infer_type_name.md
│ └── snapshots
│ │ └── tailcall__cli__llm__infer_type_name__test__chat_response_parse.snap
│ └── mod.rs
├── CONTRIBUTING.md
├── rust-toolchain.toml
├── tailcall-http-cache
└── src
│ └── lib.rs
├── .nightly
└── rust-toolchain.toml
├── assets
└── star-our-repo.gif
├── .codespellignore
├── .graphqlrc.yml
├── tailcall-version
└── Cargo.toml
├── renovate.json
├── tailcall-fixtures
├── src
│ └── lib.rs
├── fixtures
│ ├── grpc
│ │ └── reflection
│ │ │ ├── list-services.bin
│ │ │ ├── news_dto.bin
│ │ │ ├── news-service.bin
│ │ │ └── protobuf_empty.bin
│ ├── protobuf
│ │ ├── cycle.proto
│ │ ├── nested1.proto
│ │ ├── duplicate.proto
│ │ ├── nested0.proto
│ │ ├── errors.proto
│ │ ├── greetings_message.proto
│ │ ├── greetings.proto
│ │ ├── news_no_service.proto
│ │ ├── greetings_b.proto
│ │ └── map.proto
│ └── configs
│ │ └── proto_no_pkg.graphql
└── Cargo.toml
├── examples
├── empty-to-jsonplaceholder.graphql
├── .htpasswd
├── jsonplaceholder.yaml
├── scripts
│ └── echo.js
└── apollo-tracing.graphql
├── tailcall-hasher
└── Cargo.toml
├── .rustfmt.toml
├── tailcall-tracker
└── src
│ ├── lib.rs
│ └── collect
│ └── mod.rs
├── ci-benchmark
├── wrk.lua
└── sample-wrk-output.txt
├── Dockerfile
├── tailcall-typedefs-common
└── Cargo.toml
├── .cache
├── content-v2
│ └── sha256
│ │ ├── 19
│ │ └── e9
│ │ │ └── b6cbb6d22d2d210741f1a4a0981d014de21ba7d1969bd46c06865556fa4d
│ │ ├── 37
│ │ └── fa
│ │ │ └── 4e7e45654b994c977d5f6d53b9877ac0bd2d996826b2af90d1657556ea24
│ │ ├── 42
│ │ └── 81
│ │ │ └── 19ac851cd1a4d21b77c5885c92b21a8bbb17a0676853c48b5a45f1492ae9
│ │ ├── 55
│ │ └── 27
│ │ │ └── c27f2a125ec4729bcbdfc0f7f557cb3ae671e1f12a5c77b73ebb51cb3b30
│ │ ├── 59
│ │ └── 36
│ │ │ └── 5607325d39d90b3fe09515a8c76a523f81769ad493520062cbb617fdff26
│ │ ├── 0e
│ │ └── 9d
│ │ │ └── d95474f1d2afb788a45e8cff539b82fbd78618ea58e00a818314ffa95539
│ │ ├── 1b
│ │ └── ff
│ │ │ └── 18e1748d5ee4bc4aa34fe84e58b23d8d82f4fda0a5f0e3ed76158356638b
│ │ ├── 4f
│ │ └── ef
│ │ │ └── db1c0412c3b56fec0aa3a91bbb604361923201ff8699dd96d090bb154c45
│ │ ├── 7c
│ │ └── 2e
│ │ │ └── b5afe060cc88b35863210cf7e516024fceecbec2124684b15855364618f1
│ │ ├── 9e
│ │ └── 25
│ │ │ └── bb613ab99fc530b58c379c2ededdcb497f5dfc2bf8839469fb7f98f0146c
│ │ ├── ae
│ │ └── 21
│ │ │ └── a37d9b9acd0c5a55e4baa3c021874ee38c507ec0482845b21f9ff1412c25
│ │ ├── b5
│ │ └── fa
│ │ │ └── 2c14c49f87a7a32d97fd96ede0ac307568c45d4a4502c5f94e95d3f82ba0
│ │ ├── ba
│ │ └── 4a
│ │ │ └── ac767f4680965cb06c92f34e3dfafe4b6ea3932f6628c59398984dda507e
│ │ ├── c9
│ │ └── 33
│ │ │ └── 749bbc41a65c0e05e34c141047947a6783cca610a953b95ebb5e7ab3994f
│ │ ├── d5
│ │ └── 99
│ │ │ └── 453ec441b7ed51fbf430b0b5574025c3d16ec5486154240d68f1e77a7ffd
│ │ ├── dc
│ │ └── b0
│ │ │ └── 2d26e97d1d91f54ed2b70b1412ebc2d5e368c003c3114bff3ae3cb1f5fb9
│ │ ├── e0
│ │ └── 28
│ │ │ └── e3f8703ddffe0425f8556f5d37a418dae1830e1682cfa383eda894b048b3
│ │ ├── f0
│ │ └── f5
│ │ │ └── 0de33ab99b65e67665b8e7afeeb1cc0aec520c7443b732d2b5a2e663cfc5
│ │ └── f1
│ │ └── 9b
│ │ └── b6eb4d011257b1e49d23af906cd93b1c3f47092022a7c04a868d702518c2
└── index-v5
│ ├── 18
│ └── aa
│ │ └── 398fea47d489e7c87691edde2b0f4fa5f3b4
│ ├── 30
│ └── 45
│ │ └── 972e74875e2fa855fc12ab452971117dda92
│ ├── 45
│ └── 7e
│ │ └── 47040ac50b852f1a38fe4479070e56b299b1
│ ├── 48
│ └── 74
│ │ └── 7608a210fc01562ecedac30523d028b39fea
│ ├── 53
│ └── 10
│ │ └── a53948d6f8b203986a6e64657958db472bb8
│ ├── 55
│ └── ea
│ │ └── c729936c292df58fba36c3ab995beb919370
│ ├── 85
│ └── 74
│ │ └── 0bcf6123606c834080fc9ae6a80fbc7afd7c
│ ├── 0d
│ └── 50
│ │ └── 9fa0240aa36806aa13c3b26d4be0f807e53f
│ ├── a6
│ └── 44
│ │ └── a2de334c2a9de8fcbeea800160023b12ef42
│ ├── d9
│ └── c0
│ │ └── 68d3d1b731fcbc05595f7145224b715df3d6
│ ├── e6
│ └── 57
│ │ └── a828ada010420c50cf18d57762675dab61c6
│ ├── 3e
│ └── f6
│ │ └── cb54dade99e3f57978e88477b915d0eff694
│ ├── 5a
│ └── 56
│ │ └── eedeb5e5029bf1a8089268309d1d99b95b82
│ ├── dc
│ └── 8f
│ │ └── 0a1f0bb20ea2ee0f4402570a34c8276b00f7
│ ├── 5f
│ └── 3b
│ │ └── 9bca68df9ad96b96e0279b6cb9c27423df9d
│ ├── 6b
│ └── 2c
│ │ └── 6e37b86a06ca566711c8721446f88a402f16
│ ├── bf
│ └── 06
│ │ └── 5bc0932db3a16ea1d335c4d520f18e2383c5
│ ├── eb
│ └── cf
│ │ └── 474593f41b0bd59755eec4d265aae630f8fb
│ └── c9
│ └── d8
│ └── 5c58e5e52bd5fa5171267a33b5116be81480
├── .devcontainer
└── devcontainer.json
├── tailcall-macros
└── Cargo.toml
├── .gitignore
├── docker.sh
├── .prettierrc
├── benches
└── grpc
│ └── dummy.proto
├── project-words.txt
├── tailcall-prettier
└── Cargo.toml
├── .dockerignore
└── npm
└── pre-install.js
/tests/server/config/example-nokey.key:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.clippy.toml:
--------------------------------------------------------------------------------
1 | too-many-arguments-threshold = 4
2 |
--------------------------------------------------------------------------------
/codecov.yml:
--------------------------------------------------------------------------------
1 | comment:
2 | require_changes: true
3 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.rs text eol=lf
2 | *.md text eol=lf
3 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | target/
2 | generated/
3 | *.schema.json
4 |
--------------------------------------------------------------------------------
/src/core/config/transformer/consolidate_url/consolidate_url.rs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/core/jit/fixtures/mod.rs:
--------------------------------------------------------------------------------
1 | mod jp;
2 | pub use jp::*;
3 |
--------------------------------------------------------------------------------
/tests/telemetry/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod in_memory;
2 | pub mod init;
3 |
--------------------------------------------------------------------------------
/src/core/auth/jwt/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod jwks;
2 | pub mod jwt_verify;
3 |
--------------------------------------------------------------------------------
/src/core/jit/synth/mod.rs:
--------------------------------------------------------------------------------
1 | mod synth;
2 |
3 | pub use synth::Synth;
4 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | Refer: https://tailcall.run/docs/contribution-guidelines/
2 |
--------------------------------------------------------------------------------
/rust-toolchain.toml:
--------------------------------------------------------------------------------
1 | [toolchain]
2 | channel = "1.91"
3 | profile = "default"
4 |
--------------------------------------------------------------------------------
/src/core/proto_reader/mod.rs:
--------------------------------------------------------------------------------
1 | pub use reader::*;
2 | mod fetch;
3 | mod reader;
4 |
--------------------------------------------------------------------------------
/tailcall-http-cache/src/lib.rs:
--------------------------------------------------------------------------------
1 | mod cache;
2 |
3 | pub use cache::HttpCacheManager;
4 |
--------------------------------------------------------------------------------
/src/core/config/npo/mod.rs:
--------------------------------------------------------------------------------
1 | mod tracker;
2 |
3 | pub use tracker::{PathTracker, QueryPath};
4 |
--------------------------------------------------------------------------------
/.nightly/rust-toolchain.toml:
--------------------------------------------------------------------------------
1 | [toolchain]
2 | channel = "nightly-2024-10-20"
3 | profile = "default"
4 |
--------------------------------------------------------------------------------
/assets/star-our-repo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/assets/star-our-repo.gif
--------------------------------------------------------------------------------
/.codespellignore:
--------------------------------------------------------------------------------
1 | tailcall
2 | unit
3 | jsonplaceholder
4 | crate
5 | implementor
6 | implementors
7 | alo
--------------------------------------------------------------------------------
/src/core/cache/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod cache;
2 | pub mod error;
3 | pub use cache::*;
4 | pub use error::Error;
5 |
--------------------------------------------------------------------------------
/.graphqlrc.yml:
--------------------------------------------------------------------------------
1 | schema:
2 | - "./examples/jsonplaceholder.graphql"
3 | - "./generated/.tailcallrc.graphql"
4 |
--------------------------------------------------------------------------------
/src/allocator.rs:
--------------------------------------------------------------------------------
1 | use mimalloc::MiMalloc;
2 |
3 | #[global_allocator]
4 | static GLOBAL: MiMalloc = MiMalloc;
5 |
--------------------------------------------------------------------------------
/src/core/worker/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod error;
2 | pub mod worker;
3 | pub use error::Error;
4 | pub use worker::*;
5 |
--------------------------------------------------------------------------------
/src/core/auth/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod basic;
2 | pub mod error;
3 | pub mod jwt;
4 | mod verification;
5 | pub mod verify;
6 |
--------------------------------------------------------------------------------
/src/core/config/config_module/fixtures/types-2.graphql:
--------------------------------------------------------------------------------
1 | type A {
2 | b: Int!
3 | d: Float!
4 | e: String
5 | }
6 |
--------------------------------------------------------------------------------
/src/core/helpers/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod body;
2 | pub mod gql_type;
3 | pub mod headers;
4 | pub mod url;
5 | pub mod value;
6 |
--------------------------------------------------------------------------------
/src/lib.rs:
--------------------------------------------------------------------------------
1 | #[cfg(feature = "cli")]
2 | mod allocator;
3 | pub mod core;
4 |
5 | #[cfg(feature = "cli")]
6 | pub mod cli;
7 |
--------------------------------------------------------------------------------
/tests/core/mod.rs:
--------------------------------------------------------------------------------
1 | mod env;
2 | mod file;
3 | pub mod http;
4 | mod model;
5 | mod parse;
6 | mod runtime;
7 | pub mod spec;
8 |
--------------------------------------------------------------------------------
/src/cli/tc/mod.rs:
--------------------------------------------------------------------------------
1 | mod check;
2 | mod gen;
3 | mod helpers;
4 | mod init;
5 | pub mod run;
6 | mod start;
7 | mod validate_rc;
8 |
--------------------------------------------------------------------------------
/src/core/config/config_module/fixtures/types-3.graphql:
--------------------------------------------------------------------------------
1 | type A {
2 | a: Int
3 | b: [Int]
4 | c: Boolean
5 | d: Float
6 | }
7 |
--------------------------------------------------------------------------------
/src/core/mustache/mod.rs:
--------------------------------------------------------------------------------
1 | mod eval;
2 | mod model;
3 | mod parse;
4 | pub use eval::{Eval, PathStringEval};
5 | pub use model::*;
6 |
--------------------------------------------------------------------------------
/src/core/generator/proto/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod comments_builder;
2 | pub mod connect_rpc;
3 | pub mod path_builder;
4 | pub mod path_field;
5 |
--------------------------------------------------------------------------------
/src/core/graphql/mod.rs:
--------------------------------------------------------------------------------
1 | mod data_loader;
2 | mod request_template;
3 |
4 | pub use data_loader::*;
5 | pub use request_template::*;
6 |
--------------------------------------------------------------------------------
/tailcall-version/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "tailcall-version"
3 | version = "0.1.0"
4 | edition = "2021"
5 |
6 | [dependencies]
7 |
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3 | "extends": ["config:base", ":automergeMinor"]
4 | }
5 |
--------------------------------------------------------------------------------
/src/core/proto_reader/fixtures/response_b64.txt:
--------------------------------------------------------------------------------
1 | AAAAAEYSAjoAMkAKEgoQbmV3cy5OZXdzU2VydmljZQoqCihncnBjLnJlZmxlY3Rpb24udjFhbHBoYS5TZXJ2ZXJSZWZsZWN0aW9u
--------------------------------------------------------------------------------
/tailcall-fixtures/src/lib.rs:
--------------------------------------------------------------------------------
1 | // include source file that was generated by build script
2 | include!(concat!(env!("OUT_DIR"), "/fixtures.rs"));
3 |
--------------------------------------------------------------------------------
/examples/empty-to-jsonplaceholder.graphql:
--------------------------------------------------------------------------------
1 | schema @server @upstream @link(type: Config, src: "jsonplaceholder.graphql") {
2 | query: Query
3 | }
4 |
--------------------------------------------------------------------------------
/src/core/fixtures/helloworld.graphql:
--------------------------------------------------------------------------------
1 | schema {
2 | query: Query
3 | }
4 |
5 | type Query {
6 | hello: String @expr(body: "Hello, World!")
7 | }
8 |
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/grpc/reflection/list-services.bin:
--------------------------------------------------------------------------------
1 | F: 2@
2 |
3 | news.NewsService
4 | *
5 | (grpc.reflection.v1alpha.ServerReflection
--------------------------------------------------------------------------------
/tailcall-hasher/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "tailcall-hasher"
3 | version = "0.1.0"
4 | edition = "2021"
5 |
6 | [dependencies]
7 | fxhash = "0.2.1"
--------------------------------------------------------------------------------
/src/core/config/config_module/fixtures/enums-2.graphql:
--------------------------------------------------------------------------------
1 | enum enumInput {
2 | B
3 | C
4 | }
5 |
6 | enum enumOutput {
7 | B
8 | C
9 | }
10 |
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/protobuf/cycle.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package cycle;
4 |
5 | import "nested0.proto";
6 | import "duplicate.proto";
7 |
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/protobuf/nested1.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package nested1;
4 |
5 | import "news.proto";
6 | import "cycle.proto";
7 |
--------------------------------------------------------------------------------
/src/cli/generator/mod.rs:
--------------------------------------------------------------------------------
1 | #![allow(clippy::module_inception)]
2 |
3 | pub mod config;
4 | mod generator;
5 | mod source;
6 |
7 | pub use generator::Generator;
8 |
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/protobuf/duplicate.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package duplicate;
4 |
5 | import "greetings.proto";
6 | import "news.proto";
7 |
--------------------------------------------------------------------------------
/src/core/config/config_module/fixtures/unions-2.graphql:
--------------------------------------------------------------------------------
1 | type B {
2 | b: String
3 | }
4 |
5 | type C {
6 | c: Int
7 | }
8 |
9 | union Union = B | C
10 |
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/grpc/reflection/news_dto.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/tailcall-fixtures/fixtures/grpc/reflection/news_dto.bin
--------------------------------------------------------------------------------
/src/core/http/transformations/mod.rs:
--------------------------------------------------------------------------------
1 | mod body_batching;
2 | mod query_batching;
3 |
4 | pub use body_batching::BodyBatching;
5 | pub use query_batching::QueryBatching;
6 |
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/grpc/reflection/news-service.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/tailcall-fixtures/fixtures/grpc/reflection/news-service.bin
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/grpc/reflection/protobuf_empty.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/tailcall-fixtures/fixtures/grpc/reflection/protobuf_empty.bin
--------------------------------------------------------------------------------
/tests/server/config/server-start.graphql:
--------------------------------------------------------------------------------
1 | schema @server(port: 8800) {
2 | query: Query
3 | }
4 |
5 | type Query {
6 | greet: String @expr(body: "Hello World!")
7 | }
8 |
--------------------------------------------------------------------------------
/examples/.htpasswd:
--------------------------------------------------------------------------------
1 | testuser1:$apr1$e3dp9qh2$fFIfHU9bilvVZBl8TxKzL/
2 | testuser2:$2y$10$wJ/mZDURcAOBIrswCAKFsO0Nk7BpHmWl/XuhF7lNm3gBAFH3ofsuu
3 | testuser3:{SHA}Y2fEjdGT1W6nsLqtJbGUVeUp9e4=
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/protobuf/nested0.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package nested0;
4 |
5 | import "greetings.proto";
6 | import "nested1.proto";
7 | import "news_no_pkg.proto";
--------------------------------------------------------------------------------
/.rustfmt.toml:
--------------------------------------------------------------------------------
1 | unstable_features = true
2 | struct_lit_width = 60
3 | imports_granularity = "Module"
4 | group_imports = "StdExternalCrate"
5 | wrap_comments = true
6 | comment_width = 80
7 |
--------------------------------------------------------------------------------
/src/core/config/transformer/merge_types/mod.rs:
--------------------------------------------------------------------------------
1 | mod mergeable_types;
2 | mod pair_map;
3 | mod pair_set;
4 | mod similarity;
5 | mod type_merger;
6 |
7 | pub use type_merger::TypeMerger;
8 |
--------------------------------------------------------------------------------
/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/npo/tracker.rs
3 | expression: actual
4 | snapshot_kind: text
5 | ---
6 |
7 |
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/protobuf/errors.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package greetings;
4 |
5 | // The error message definition.
6 | message ErrValidation {
7 | string error = 1;
8 | }
--------------------------------------------------------------------------------
/src/cli/llm/mod.rs:
--------------------------------------------------------------------------------
1 | mod error;
2 | pub mod infer_type_name;
3 | pub use error::Error;
4 | use error::Result;
5 | pub use infer_type_name::InferTypeName;
6 | mod wizard;
7 |
8 | pub use wizard::Wizard;
9 |
--------------------------------------------------------------------------------
/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__batched_resolvers.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/npo/tracker.rs
3 | expression: actual
4 | snapshot_kind: text
5 | ---
6 |
7 |
--------------------------------------------------------------------------------
/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_non_list.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/npo/tracker.rs
3 | expression: actual
4 | snapshot_kind: text
5 | ---
6 |
7 |
--------------------------------------------------------------------------------
/tailcall-tracker/src/lib.rs:
--------------------------------------------------------------------------------
1 | mod can_track;
2 | mod collect;
3 | mod dispatch;
4 | mod error;
5 | mod event;
6 | pub use dispatch::Tracker;
7 | use error::Result;
8 | pub use event::{Event, EventKind};
9 |
--------------------------------------------------------------------------------
/tests/execution/test-invalid-server.md:
--------------------------------------------------------------------------------
1 | ---
2 | error: true
3 | ---
4 |
5 | # test-invalid-server
6 |
7 | ```graphql @schema
8 | schema @server(port: "8000") {
9 | query: Query
10 | }
11 | ```
12 |
--------------------------------------------------------------------------------
/ci-benchmark/wrk.lua:
--------------------------------------------------------------------------------
1 | wrk.method = "POST"
2 | wrk.body = '{"operationName":null,"variables":{},"query":"{posts{title}}"}'
3 | wrk.headers["Connection"] = "keep-alive"
4 | wrk.headers["Content-Type"] = "application/json"
--------------------------------------------------------------------------------
/src/core/config/config_module/fixtures/enums-3.graphql:
--------------------------------------------------------------------------------
1 | enum enumInput {
2 | B
3 | C
4 | }
5 |
6 | enum enumOutput {
7 | B
8 | C
9 | }
10 |
11 | type A {
12 | b(x: enumOutput): enumInput
13 | }
14 |
--------------------------------------------------------------------------------
/src/core/config/config_module/fixtures/types-1.graphql:
--------------------------------------------------------------------------------
1 | schema {
2 | query: Query
3 | }
4 |
5 | type Query {
6 | a: A
7 | }
8 |
9 | type A {
10 | a: String
11 | b: Int
12 | c: Boolean
13 | }
14 |
--------------------------------------------------------------------------------
/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__from_proto_no_service_file.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/generator/from_proto.rs
3 | expression: result
4 | snapshot_kind: text
5 | ---
6 |
7 |
--------------------------------------------------------------------------------
/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__resolvers.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/npo/tracker.rs
3 | expression: actual
4 | snapshot_kind: text
5 | ---
6 | query { f1 { f2 } }
7 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:latest
2 | RUN apt-get update && apt-get install -y curl jq
3 | RUN curl -sSL https://raw.githubusercontent.com/tailcallhq/tailcall/master/install.sh | bash -s
4 | ENV PATH="${PATH}:~/.tailcall/bin"
5 |
--------------------------------------------------------------------------------
/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers_without_resolvers.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/npo/tracker.rs
3 | expression: actual
4 | snapshot_kind: text
5 | ---
6 |
7 |
--------------------------------------------------------------------------------
/tests/execution/test-missing-root-types.md:
--------------------------------------------------------------------------------
1 | ---
2 | error: true
3 | ---
4 |
5 | # test-missing-root-types
6 |
7 | ```graphql @schema
8 | schema {
9 | query: QueryType
10 | mutation: MutationDef
11 | }
12 | ```
13 |
--------------------------------------------------------------------------------
/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles_with_resolvers.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/npo/tracker.rs
3 | expression: actual
4 | snapshot_kind: text
5 | ---
6 | query { f1 { f2 } }
7 |
--------------------------------------------------------------------------------
/tailcall-typedefs-common/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "tailcall-typedefs-common"
3 | version = "0.1.0"
4 | edition = "2021"
5 |
6 | [dependencies]
7 | async-graphql = { workspace = true }
8 | schemars = { version = "0.8.17" }
9 |
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/0e/9d/d95474f1d2afb788a45e8cff539b82fbd78618ea58e00a818314ffa95539:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/0e/9d/d95474f1d2afb788a45e8cff539b82fbd78618ea58e00a818314ffa95539
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/19/e9/b6cbb6d22d2d210741f1a4a0981d014de21ba7d1969bd46c06865556fa4d:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/19/e9/b6cbb6d22d2d210741f1a4a0981d014de21ba7d1969bd46c06865556fa4d
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/1b/ff/18e1748d5ee4bc4aa34fe84e58b23d8d82f4fda0a5f0e3ed76158356638b:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/1b/ff/18e1748d5ee4bc4aa34fe84e58b23d8d82f4fda0a5f0e3ed76158356638b
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/37/fa/4e7e45654b994c977d5f6d53b9877ac0bd2d996826b2af90d1657556ea24:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/37/fa/4e7e45654b994c977d5f6d53b9877ac0bd2d996826b2af90d1657556ea24
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/42/81/19ac851cd1a4d21b77c5885c92b21a8bbb17a0676853c48b5a45f1492ae9:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/42/81/19ac851cd1a4d21b77c5885c92b21a8bbb17a0676853c48b5a45f1492ae9
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/4f/ef/db1c0412c3b56fec0aa3a91bbb604361923201ff8699dd96d090bb154c45:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/4f/ef/db1c0412c3b56fec0aa3a91bbb604361923201ff8699dd96d090bb154c45
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/55/27/c27f2a125ec4729bcbdfc0f7f557cb3ae671e1f12a5c77b73ebb51cb3b30:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/55/27/c27f2a125ec4729bcbdfc0f7f557cb3ae671e1f12a5c77b73ebb51cb3b30
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/59/36/5607325d39d90b3fe09515a8c76a523f81769ad493520062cbb617fdff26:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/59/36/5607325d39d90b3fe09515a8c76a523f81769ad493520062cbb617fdff26
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/7c/2e/b5afe060cc88b35863210cf7e516024fceecbec2124684b15855364618f1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/7c/2e/b5afe060cc88b35863210cf7e516024fceecbec2124684b15855364618f1
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/9e/25/bb613ab99fc530b58c379c2ededdcb497f5dfc2bf8839469fb7f98f0146c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/9e/25/bb613ab99fc530b58c379c2ededdcb497f5dfc2bf8839469fb7f98f0146c
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/ae/21/a37d9b9acd0c5a55e4baa3c021874ee38c507ec0482845b21f9ff1412c25:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/ae/21/a37d9b9acd0c5a55e4baa3c021874ee38c507ec0482845b21f9ff1412c25
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/b5/fa/2c14c49f87a7a32d97fd96ede0ac307568c45d4a4502c5f94e95d3f82ba0:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/b5/fa/2c14c49f87a7a32d97fd96ede0ac307568c45d4a4502c5f94e95d3f82ba0
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/ba/4a/ac767f4680965cb06c92f34e3dfafe4b6ea3932f6628c59398984dda507e:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/ba/4a/ac767f4680965cb06c92f34e3dfafe4b6ea3932f6628c59398984dda507e
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/c9/33/749bbc41a65c0e05e34c141047947a6783cca610a953b95ebb5e7ab3994f:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/c9/33/749bbc41a65c0e05e34c141047947a6783cca610a953b95ebb5e7ab3994f
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/d5/99/453ec441b7ed51fbf430b0b5574025c3d16ec5486154240d68f1e77a7ffd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/d5/99/453ec441b7ed51fbf430b0b5574025c3d16ec5486154240d68f1e77a7ffd
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/dc/b0/2d26e97d1d91f54ed2b70b1412ebc2d5e368c003c3114bff3ae3cb1f5fb9:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/dc/b0/2d26e97d1d91f54ed2b70b1412ebc2d5e368c003c3114bff3ae3cb1f5fb9
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/e0/28/e3f8703ddffe0425f8556f5d37a418dae1830e1682cfa383eda894b048b3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/e0/28/e3f8703ddffe0425f8556f5d37a418dae1830e1682cfa383eda894b048b3
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/f0/f5/0de33ab99b65e67665b8e7afeeb1cc0aec520c7443b732d2b5a2e663cfc5:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/f0/f5/0de33ab99b65e67665b8e7afeeb1cc0aec520c7443b732d2b5a2e663cfc5
--------------------------------------------------------------------------------
/.cache/content-v2/sha256/f1/9b/b6eb4d011257b1e49d23af906cd93b1c3f47092022a7c04a868d702518c2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tailcallhq/tailcall/HEAD/.cache/content-v2/sha256/f1/9b/b6eb4d011257b1e49d23af906cd93b1c3f47092022a7c04a868d702518c2
--------------------------------------------------------------------------------
/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__cycles_with_resolver.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/npo/tracker.rs
3 | expression: actual
4 | snapshot_kind: text
5 | ---
6 | query { f1 { f1 { f2 } } }
7 |
--------------------------------------------------------------------------------
/tests/core/snapshots/auth.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | data: String
8 | }
9 |
10 | schema {
11 | query: Query
12 | }
13 |
--------------------------------------------------------------------------------
/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/npo/tracker.rs
3 | expression: actual
4 | snapshot_kind: text
5 | ---
6 | query { f1 { f2 { f3 { f4 } } } }
7 |
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/protobuf/greetings_message.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package greetings;
4 |
5 | message HelloRequest {
6 | string name = 1;
7 | }
8 |
9 | message HelloReply {
10 | string message = 1;
11 | }
--------------------------------------------------------------------------------
/tests/core/snapshots/auth_order.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | data: String
8 | }
9 |
10 | schema {
11 | query: Query
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-expr.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | hello: String
8 | }
9 |
10 | schema {
11 | query: Query
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-query.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | foo: String
8 | }
9 |
10 | schema {
11 | query: Query
12 | }
13 |
--------------------------------------------------------------------------------
/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__multiple_keys.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/npo/tracker.rs
3 | expression: actual
4 | snapshot_kind: text
5 | ---
6 | query { f1 { f2 } }
7 | query { f1 { f3 } }
8 |
--------------------------------------------------------------------------------
/tests/core/snapshots/apollo-tracing.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | hello: String!
8 | }
9 |
10 | schema {
11 | query: Query
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/cors-allow-cred-false.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | val: Int
8 | }
9 |
10 | schema {
11 | query: Query
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/cors-allow-cred-true.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | val: Int
8 | }
9 |
10 | schema {
11 | query: Query
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/cors-allow-cred-vary.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | val: Int
8 | }
9 |
10 | schema {
11 | query: Query
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/custom-headers.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | greet: String
8 | }
9 |
10 | schema {
11 | query: Query
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-http-headers.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | foo: String
8 | }
9 |
10 | schema {
11 | query: Query
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-server-vars.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | foo: String
8 | }
9 |
10 | schema {
11 | query: Query
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-upstream.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | hello: String
8 | }
9 |
10 | schema {
11 | query: Query
12 | }
13 |
--------------------------------------------------------------------------------
/tests/http/config/simple.graphql:
--------------------------------------------------------------------------------
1 | schema {
2 | query: Query
3 | }
4 |
5 | type User {
6 | id: Int
7 | name: String
8 | }
9 |
10 | type Query {
11 | user: User @http(url: "http://jsonplaceholder.typicode.com/users/1")
12 | }
13 |
--------------------------------------------------------------------------------
/tests/snapshots/jit_spec__tests__executor_arguments.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/jit_spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "data": {
8 | "user": {
9 | "id": 1
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/core/generator/tests/fixtures/json/empty_list.json:
--------------------------------------------------------------------------------
1 | {
2 | "request": {
3 | "url": "https://example.com/users"
4 | },
5 | "fieldName": "users",
6 | "response": {
7 | "statusCode": 200,
8 | "body": []
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/core/generator/tests/fixtures/json/null.json:
--------------------------------------------------------------------------------
1 | {
2 | "request": {
3 | "url": "https://example.com/users?age=12"
4 | },
5 | "fieldName": "usersAge",
6 | "response": {
7 | "status": 204,
8 | "body": null
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/tests/core/snapshots/inline-index-list.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | username: String
8 | }
9 |
10 | schema {
11 | query: Query
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/omit-index-list.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | username: String
8 | }
9 |
10 | schema {
11 | query: Query
12 | }
13 |
--------------------------------------------------------------------------------
/src/core/grpc/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod data_loader;
2 | pub mod data_loader_request;
3 | pub mod protobuf;
4 | pub mod request;
5 | pub mod request_template;
6 |
7 | pub use data_loader_request::DataLoaderRequest;
8 | pub use request_template::RequestTemplate;
9 |
--------------------------------------------------------------------------------
/tests/execution/test-missing-schema-query.md:
--------------------------------------------------------------------------------
1 | ---
2 | error: true
3 | ---
4 |
5 | # test-missing-schema-query
6 |
7 | ```graphql @schema
8 | schema {
9 | mutation: Mutation
10 | }
11 |
12 | type Mutation {
13 | id: Int!
14 | }
15 | ```
16 |
--------------------------------------------------------------------------------
/src/core/config/config_module/fixtures/unions-1.graphql:
--------------------------------------------------------------------------------
1 | schema {
2 | query: Query
3 | }
4 |
5 | type Query {
6 | b: B
7 | }
8 |
9 | type A {
10 | a: String
11 | }
12 |
13 | type B {
14 | b: String
15 | }
16 |
17 | union Union = A | B
18 |
--------------------------------------------------------------------------------
/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_resolvers_non_list_resolvers.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/npo/tracker.rs
3 | expression: actual
4 | snapshot_kind: text
5 | ---
6 | query { f1 { f2 { f3 { f4 } } } }
7 |
--------------------------------------------------------------------------------
/src/core/generator/tests/fixtures/json/boolean.json:
--------------------------------------------------------------------------------
1 | {
2 | "request": {
3 | "url": "https://example.com/user/12/online"
4 | },
5 | "fieldName": "userStatus",
6 | "response": {
7 | "status": 200,
8 | "body": true
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | {
2 | "image": "mcr.microsoft.com/devcontainers/universal:2",
3 | "features": {
4 | "ghcr.io/devcontainers/features/rust:1": {
5 | "version": "1.75",
6 | "profile": "default"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/core/generator/tests/fixtures/json/string.json:
--------------------------------------------------------------------------------
1 | {
2 | "request": {
3 | "url": "https://example.com/login/status"
4 | },
5 | "fieldName": "loginStatus",
6 | "response": {
7 | "status": 200,
8 | "body": "successfully"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/protobuf/greetings.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package greetings;
4 |
5 | import "greetings_message.proto";
6 |
7 | service Greeter {
8 | rpc SayHello (greetings.HelloRequest) returns (greetings.HelloReply) {}
9 | }
10 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-http-baseurl.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | bar: String
8 | foo: String
9 | }
10 |
11 | schema {
12 | query: Query
13 | }
14 |
--------------------------------------------------------------------------------
/src/core/config/npo/fixtures/cycles.graphql:
--------------------------------------------------------------------------------
1 | schema @server @upstream {
2 | query: Query
3 | }
4 |
5 | type F1 {
6 | f1: F1
7 | f2: [F2]
8 | }
9 |
10 | type F2 {
11 | f3: String
12 | }
13 |
14 | type Query {
15 | f1: [F1] @http(url: "")
16 | }
17 |
--------------------------------------------------------------------------------
/src/core/config/npo/fixtures/nested-non-list.graphql:
--------------------------------------------------------------------------------
1 | schema @server @upstream {
2 | query: Query
3 | }
4 |
5 | type F {
6 | g: [G] @http(url: "")
7 | }
8 |
9 | type G {
10 | e: String
11 | }
12 |
13 | type Query {
14 | f: F @http(url: "")
15 | }
16 |
--------------------------------------------------------------------------------
/src/core/config/npo/fixtures/nested-without-resolvers.graphql:
--------------------------------------------------------------------------------
1 | schema @server @upstream {
2 | query: Query
3 | }
4 |
5 | type F1 {
6 | f2: [F2]
7 | }
8 |
9 | type F2 {
10 | f3: String
11 | }
12 |
13 | type Query {
14 | f1: [F1] @http(url: "")
15 | }
16 |
--------------------------------------------------------------------------------
/src/core/generator/tests/fixtures/json/number.json:
--------------------------------------------------------------------------------
1 | {
2 | "request": {
3 | "url": "https://example.com/users?verified_user=true"
4 | },
5 | "fieldName": "verifiedUsers",
6 | "response": {
7 | "status": 200,
8 | "body": 12
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-custom-scalar.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | scalar Json
7 |
8 | type Query {
9 | foo: [Json]
10 | }
11 |
12 | schema {
13 | query: Query
14 | }
15 |
--------------------------------------------------------------------------------
/tests/execution/test-expr.md:
--------------------------------------------------------------------------------
1 | ---
2 | identity: true
3 | ---
4 |
5 | # test-expr
6 |
7 | ```graphql @schema
8 | schema @server @upstream {
9 | query: Query
10 | }
11 |
12 | type Query {
13 | hello: String @expr(body: "Hello from server")
14 | }
15 | ```
16 |
--------------------------------------------------------------------------------
/examples/jsonplaceholder.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=../generated/.tailcallrc.schema.json
2 |
3 | server:
4 | port: 8000
5 |
6 | upstream:
7 | batch:
8 | delay: 100
9 | httpCache: 42
10 |
11 | links:
12 | - src: ./jsonplaceholder.graphql
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-js-request-response-2.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | hello: String
8 | hi: String
9 | }
10 |
11 | schema {
12 | query: Query
13 | }
14 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-js-request-response.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | hello: String
8 | hi: String
9 | }
10 |
11 | schema {
12 | query: Query
13 | }
14 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-omit.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type B {
7 | c: String
8 | }
9 |
10 | type Query {
11 | foo: B
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/src/core/config/npo/fixtures/simple-resolvers.graphql:
--------------------------------------------------------------------------------
1 | schema @server @upstream {
2 | query: Query
3 | }
4 |
5 | type F1 {
6 | f2: [F2] @http(url: "")
7 | }
8 |
9 | type F2 {
10 | f3: String
11 | }
12 |
13 | type Query {
14 | f1: [F1] @http(url: "")
15 | }
16 |
--------------------------------------------------------------------------------
/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_config.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/npo/tracker.rs
3 | expression: actual
4 | snapshot_kind: text
5 | ---
6 | query { bar { spam } }
7 | query { buzz { spam } }
8 | query { foo { spam } }
9 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-inline.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type B {
7 | c: String
8 | }
9 |
10 | type Query {
11 | foo: B
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-js-multi-onRequest-handlers.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | bar: String
8 | foo: String
9 | }
10 |
11 | schema {
12 | query: Query
13 | }
14 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-omit-list.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type B {
7 | c: String
8 | }
9 |
10 | type Query {
11 | foo: B
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/execution/test-no-base-url.md:
--------------------------------------------------------------------------------
1 | ---
2 | error: true
3 | ---
4 |
5 | # test-no-base-url
6 |
7 | ```graphql @schema
8 | schema {
9 | query: Query
10 | }
11 |
12 | type User {
13 | id: ID!
14 | }
15 |
16 | type Query {
17 | user: User @http()
18 | }
19 | ```
20 |
--------------------------------------------------------------------------------
/tests/server/config/example-ec.key:
--------------------------------------------------------------------------------
1 | -----BEGIN EC PRIVATE KEY-----
2 | MHcCAQEEIA3ZpHVufHM8Jqpjr/Km3ux1UhkEa8ePqmsU3qeiZuuNoAoGCCqGSM49
3 | AwEHoUQDQgAE6IhSNlossCJK2o88S+a4vta0PsKsg8VPQhyaNt00bRaAO++v6tZz
4 | AeNwLeMRaho/SB/akz6Lwb2OXd6CmOe/8Q==
5 | -----END EC PRIVATE KEY-----
6 |
--------------------------------------------------------------------------------
/src/core/error.rs:
--------------------------------------------------------------------------------
1 | use derive_more::From;
2 |
3 | use super::worker;
4 |
5 | #[derive(From, thiserror::Error, Debug)]
6 | pub enum Error {
7 | #[error("Worker Error")]
8 | Worker(worker::Error),
9 | }
10 |
11 | pub type Result = std::result::Result;
12 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-inline-list.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type B {
7 | c: String
8 | }
9 |
10 | type Query {
11 | foo: B
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/snapshots/jit_spec__tests__executor_variables-2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/jit_spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "data": {
8 | "user": {
9 | "id": 1,
10 | "name": "Leanne Graham"
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/core/generator/tests/fixtures/json/list_primitive_type.json:
--------------------------------------------------------------------------------
1 | {
2 | "request": {
3 | "url": "https://example.com/users"
4 | },
5 | "fieldName": "users",
6 | "response": {
7 | "status": 200,
8 | "body": ["test-1", "test-2", "test-3", "test-4"]
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/core/config/npo/fixtures/cyclic-resolver.graphql:
--------------------------------------------------------------------------------
1 | schema @server @upstream {
2 | query: Query
3 | }
4 |
5 | type F1 {
6 | f1: [F1]
7 | f2: String @http(url: "")
8 | }
9 |
10 | type F2 {
11 | f3: String
12 | }
13 |
14 | type Query {
15 | f1: F1 @http(url: "")
16 | }
17 |
--------------------------------------------------------------------------------
/src/core/config/npo/fixtures/cyclic-resolvers.graphql:
--------------------------------------------------------------------------------
1 | schema @server @upstream {
2 | query: Query
3 | }
4 |
5 | type F1 {
6 | f1: [F1]
7 | f2: String @http(url: "")
8 | }
9 |
10 | type F2 {
11 | f3: String
12 | }
13 |
14 | type Query {
15 | f1: [F1] @http(url: "")
16 | }
17 |
--------------------------------------------------------------------------------
/src/core/snapshots/tailcall__core__tests__include_config.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/mod.rs
3 | expression: cfg
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | hello: String @expr(body: "Hello, World!")
12 | }
13 |
--------------------------------------------------------------------------------
/tailcall-macros/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "tailcall-macros"
3 | version = "0.1.0"
4 | edition = "2021"
5 |
6 | [lib]
7 | proc-macro = true
8 |
9 | [dependencies]
10 | syn = { version = "2.0.60", features = ["derive", "full"] }
11 | quote = "1.0.36"
12 | proc-macro2 = "1.0.81"
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/inline-field.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user: User
8 | }
9 |
10 | type User {
11 | address: String
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/modified-field.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user: User
8 | }
9 |
10 | type User {
11 | fullname: String
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-enum-aliases.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | enum Foo {
7 | BAR
8 | BAZ
9 | }
10 |
11 | type Query {
12 | foo: Foo
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-query-documentation.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | """
8 | This is test
9 | """
10 | foo: String
11 | }
12 |
13 | schema {
14 | query: Query
15 | }
16 |
--------------------------------------------------------------------------------
/tests/execution/test-query.md:
--------------------------------------------------------------------------------
1 | ---
2 | identity: true
3 | ---
4 |
5 | # test-query
6 |
7 | ```graphql @schema
8 | schema @server @upstream {
9 | query: Query
10 | }
11 |
12 | type Query {
13 | foo: String @http(url: "http://jsonplaceholder.typicode.com/foo")
14 | }
15 | ```
16 |
--------------------------------------------------------------------------------
/tests/execution/undeclared-type.md:
--------------------------------------------------------------------------------
1 | ---
2 | error: true
3 | ---
4 |
5 | # undeclared-type
6 |
7 | ```graphql @schema
8 | schema @server {
9 | query: Query
10 | }
11 |
12 | type Query {
13 | users: [User] @http(url: "http://jsonplaceholder.typicode.com/users")
14 | }
15 | ```
16 |
--------------------------------------------------------------------------------
/src/core/config/npo/fixtures/simple-batch-resolver.graphql:
--------------------------------------------------------------------------------
1 | schema @server @upstream {
2 | query: Query
3 | }
4 |
5 | type F1 {
6 | f2: [F2] @http(batchKey: ["id"], url: "")
7 | }
8 |
9 | type F2 {
10 | f3: String
11 | }
12 |
13 | type Query {
14 | f1: [F1] @http(url: "")
15 | }
16 |
--------------------------------------------------------------------------------
/tailcall-fixtures/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "tailcall-fixtures"
3 | version = "0.1.0"
4 | edition = "2021"
5 | publish = false
6 |
7 | [build-dependencies]
8 | convert_case = "0.6.0"
9 | indenter = { version = "0.3.3", features = ["std"] }
10 | derive_more = { workspace = true }
11 |
--------------------------------------------------------------------------------
/tests/core/snapshots/batching.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user: User
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/resolved-by-parent.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user: User
8 | }
9 |
10 | type User {
11 | address: String
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-enum.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | enum Foo {
7 | BAR
8 | BAZ
9 | }
10 |
11 | type Query {
12 | foo(val: String!): Foo
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-grpc-proto-path.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "No such file or directory (os error 2)",
9 | "trace": [],
10 | "description": null
11 | }
12 | ]
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-list-args.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | f1(q: [Int!]!): T1
8 | }
9 |
10 | type T1 {
11 | numbers: [Int]
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-modify.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | input Foo {
7 | bar: String
8 | }
9 |
10 | type Query {
11 | data(input: Foo): String
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/upstream-fail-request-with-body.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | ---
5 | type Query {
6 | user: User
7 | }
8 |
9 | type User {
10 | id: Int
11 | name: String
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/with-args.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: Int!): [User]
8 | }
9 |
10 | type User {
11 | name: String
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/execution/test-enum-empty.md:
--------------------------------------------------------------------------------
1 | ---
2 | error: true
3 | ---
4 |
5 | # test-enum-empty
6 |
7 | ```graphql @schema
8 | schema @server {
9 | query: Query
10 | }
11 |
12 | type Query {
13 | foo(val: String!): Foo @expr(body: "{{.args.val}}")
14 | }
15 |
16 | enum Foo {}
17 | ```
18 |
--------------------------------------------------------------------------------
/.cache/index-v5/45/7e/47040ac50b852f1a38fe4479070e56b299b1:
--------------------------------------------------------------------------------
1 |
2 | 8f6c1c035d52ff54717776ad82cb71b18403a4dbd90c870da0f039237e81e935 {"key":"GET:https://api.deezer.com/chart","integrity":"sha256-G/8Y4XSNXuS8SqNP6E5Ysj2NgvT9oKXw4+12FYNWY4s=","time":1729918929051,"size":8924,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/src/cli/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod command;
2 | mod fmt;
3 | pub mod generator;
4 | #[cfg(feature = "js")]
5 | pub mod javascript;
6 | mod llm;
7 | pub mod metrics;
8 | pub mod runtime;
9 | pub mod server;
10 | mod tc;
11 | pub mod telemetry;
12 | pub(crate) mod update_checker;
13 | pub use tc::run::run;
14 |
--------------------------------------------------------------------------------
/src/core/config/config_module/fixtures/enums-1.graphql:
--------------------------------------------------------------------------------
1 | schema {
2 | query: Query
3 | }
4 |
5 | type Query {
6 | a: A
7 | }
8 |
9 | enum enumInput {
10 | A
11 | B
12 | }
13 |
14 | enum enumOutput {
15 | A
16 | B
17 | }
18 |
19 | type A {
20 | a(x: enumInput): enumOutput
21 | }
22 |
--------------------------------------------------------------------------------
/src/core/generator/json/mod.rs:
--------------------------------------------------------------------------------
1 | mod http_directive_generator;
2 | mod operation_generator;
3 | mod schema_generator;
4 | mod types_generator;
5 |
6 | pub use operation_generator::OperationTypeGenerator;
7 | pub use schema_generator::SchemaGenerator;
8 | pub use types_generator::GraphQLTypesGenerator;
9 |
--------------------------------------------------------------------------------
/tests/core/snapshots/omit-resolved-by-parent.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user: User
8 | }
9 |
10 | type User {
11 | address: String
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/simple-graphql.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user: User
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-cache.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user: User
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-enum-merge.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | enum Foo {
7 | BAR
8 | BAZ
9 | BOOM
10 | }
11 |
12 | type Query {
13 | foo: Foo
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-http.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | foo: [User]
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-merge-input.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | foo(x: Test): Boolean
8 | }
9 |
10 | input Test {
11 | b: String
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-merge-right-with-link-config.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Foo {
7 | bar: String
8 | }
9 |
10 | type Query {
11 | foo: Foo
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-missing-schema-query.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "schema definition is missing query root",
9 | "trace": [],
10 | "description": null
11 | }
12 | ]
13 |
--------------------------------------------------------------------------------
/.cache/index-v5/0d/50/9fa0240aa36806aa13c3b26d4be0f807e53f:
--------------------------------------------------------------------------------
1 |
2 | a59788fe402c268993231b56f1174e56dc5ae3d2f26a59a7d5c0550ef131aecc {"key":"GET:https://api.deezer.com/user/2529","integrity":"sha256-riGjfZuazQxaVeS6o8Ahh07jjFB+wEgoRbIfn/FBLCU=","time":1729918929552,"size":1318,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.cache/index-v5/53/10/a53948d6f8b203986a6e64657958db472bb8:
--------------------------------------------------------------------------------
1 |
2 | 41e73f4aed7bd3f3b0d117119ed0b4c84a9d4dbd95145bf8d6868387254aab47 {"key":"GET:https://api.deezer.com/editorial","integrity":"sha256-VSfCfyoSXsRym8vfwPf1V8s65nHh8Spcd7c+u1HLOzA=","time":1729918929327,"size":2476,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.cache/index-v5/a6/44/a2de334c2a9de8fcbeea800160023b12ef42:
--------------------------------------------------------------------------------
1 |
2 | b517c5ac356c6850255b0d1eae8e9c2f54b745855a6835c3d05731bb64e9b2b8 {"key":"GET:https://api.deezer.com/album/302127","integrity":"sha256-fC61r+BgzIizWGMhDPflFgJPzuy+whJGhLFYVTZGGPE=","time":1729918925014,"size":3615,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.cache/index-v5/d9/c0/68d3d1b731fcbc05595f7145224b715df3d6:
--------------------------------------------------------------------------------
1 |
2 | d58ef53cd1b1aa0afc9c3e1bf84b3e20b5ffc760ca20027cf442672ca3ac69ca {"key":"GET:https://api.deezer.com/track/3135556","integrity":"sha256-8PUN4zq5m2XmdmW456/uscwK7FIMdEO3MtK1ouZjz8U=","time":1729918924756,"size":2761,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.cache/index-v5/e6/57/a828ada010420c50cf18d57762675dab61c6:
--------------------------------------------------------------------------------
1 |
2 | 0e037f975b06346f8aac00291998fcb85b90e694e086fbea63c86adf016f2bf9 {"key":"GET:https://api.deezer.com/artist/27","integrity":"sha256-4Cjj+HA93/4EJfhVb103pBja4YMOFoLPo4PtqJSwSLM=","time":1729918925243,"size":1386,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/tests/core/snapshots/js-directive.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | hello: User!
8 | }
9 |
10 | type User {
11 | id: Int!
12 | name: String!
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/rename-field.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user1: User
8 | user2: User
9 | }
10 |
11 | type User {
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/resolve-with-vars.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user: [User]
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/simple-query.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | firstUser: User
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/.cache/index-v5/3e/f6/cb54dade99e3f57978e88477b915d0eff694:
--------------------------------------------------------------------------------
1 |
2 | 2e9cfec608929d69b2925046b5aaba277d66fada8a22d7dc178520c93965646a {"key":"GET:http://jsonplaceholder.typicode.com/todos","integrity":"sha256-niW7YTq5n8UwtYw3nC7e3ctJf138K/iDlGn7f5jwFGw=","time":1729918926899,"size":5154,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.cache/index-v5/5a/56/eedeb5e5029bf1a8089268309d1d99b95b82:
--------------------------------------------------------------------------------
1 |
2 | 81f4568d53fd0b6c540f928305fc023aed4b5cf0770b1631a43ce349d9ce178a {"key":"GET:http://jsonplaceholder.typicode.com/users","integrity":"sha256-QoEZrIUc0aTSG3fFiFySshqLuxegZ2hTxItaRfFJKuk=","time":1729918924776,"size":2910,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.cache/index-v5/85/74/0bcf6123606c834080fc9ae6a80fbc7afd7c:
--------------------------------------------------------------------------------
1 |
2 | a862eecb319e2e5360dcc8c3191381f9f9e9d21ca377bfd658921ba7351f4530 {"key":"GET:http://jsonplaceholder.typicode.com/posts","integrity":"sha256-ukqsdn9GgJZcsGyS8049+v5LbqOTL2YoxZOYmE3aUH4=","time":1729918925103,"size":8295,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.cache/index-v5/dc/8f/0a1f0bb20ea2ee0f4402570a34c8276b00f7:
--------------------------------------------------------------------------------
1 |
2 | 192f0b1251536b1de7ab44f59602bc50721175af12eef643da3436a4bf607ecb {"key":"GET:https://api.deezer.com/search?q=eminem","integrity":"sha256-tfosFMSfh6ejLZf9lu3grDB1aMRdSkUCxflOldP4K6A=","time":1729918930181,"size":1163,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /.idea
3 | /.vscode
4 | .DS_Store
5 | .bsp
6 | # direnv
7 | .direnv
8 | .envrc
9 | .env
10 |
11 | npm/@tailcallhq
12 | node_modules/
13 |
14 | # cloudflare
15 | .wrangler/
16 | tailcall-/cloudflare/build
17 |
18 | *.snap.new
19 | flamegraph.svg
20 | perf.data
21 | perf.data.old
22 |
--------------------------------------------------------------------------------
/src/core/blueprint/fixture/recursive-arg.graphql:
--------------------------------------------------------------------------------
1 | schema @server(port: 8000) {
2 | query: Query
3 | }
4 | type Query {
5 | posts(id: PostData): Int @http(url: "upstream.com", query: [{key: "id", value: "{{.args.id.data}}"}])
6 | }
7 | type PostData {
8 | author: String
9 | data: PostData
10 | }
11 |
--------------------------------------------------------------------------------
/tests/core/snapshots/auth-multiple.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | a_and_b: String
8 | b_and_c: String
9 | c_and_a: String
10 | default: String
11 | }
12 |
13 | schema {
14 | query: Query
15 | }
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/cache-control.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: Int): User
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/default-value-arg.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | input Input {
7 | id: Int!
8 | }
9 |
10 | type Query {
11 | bar(input: Input = {id: 1}): Int
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/experimental-headers.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | users: [User]
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/rest-api.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "id": 1,
13 | "name": "foo"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/rest-api.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: Int!): User
8 | }
9 |
10 | type User {
11 | id: Int!
12 | name: String!
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/routes-param-on-server-directive.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | users: [User]
8 | }
9 |
10 | type User {
11 | name: String
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/showcase.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | not_user: User
8 | }
9 |
10 | type User {
11 | not_id: Int
12 | not_name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-merge-server-sdl.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | foo: [User]
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/upstream-fail-request.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user: User
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/with-args-url.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: Int!): User
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/snapshots/jit_spec__tests__executor_variables.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/jit_spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "data": null,
8 | "errors": [
9 | {
10 | "message": "ResolveInputError: Variable `id` is not defined"
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/tests/snapshots/jit_spec__tests__operation_plan_cache.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/jit_spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "data": null,
8 | "errors": [
9 | {
10 | "message": "ResolveInputError: Variable `id` is not defined"
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/.cache/index-v5/18/aa/398fea47d489e7c87691edde2b0f4fa5f3b4:
--------------------------------------------------------------------------------
1 |
2 | f088c120fc7948480ab24a8dee7b2a891ba434f88ac079648297b3b0a5d757da {"key":"GET:http://jsonplaceholder.typicode.com/photos","integrity":"sha256-yTN0m7xBplwOBeNMFBBHlHpng8ymEKlTuV67XnqzmU8=","time":1729918926505,"size":133192,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.cache/index-v5/30/45/972e74875e2fa855fc12ab452971117dda92:
--------------------------------------------------------------------------------
1 |
2 | 6ef5556c3f41b191f1a147831751b37094605e9e999176003106699a3f575b67 {"key":"GET:http://jsonplaceholder.typicode.com/users/1","integrity":"sha256-3LAtJul9HZH1TtK3CxQS68LV42jAA8MRS/8648sfX7k=","time":1729918924922,"size":1399,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.cache/index-v5/48/74/7608a210fc01562ecedac30523d028b39fea:
--------------------------------------------------------------------------------
1 |
2 | 30740765bee9d84c3b8849201f2d110f4a9e62baa7f7cfd647d9b642506e959a {"key":"GET:http://jsonplaceholder.typicode.com/comments/1","integrity":"sha256-T+/bHAQSw7Vv7AqjqRu7YENhkjIB/4aZ3ZbQkLsVTEU=","time":1729918925818,"size":1278,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.cache/index-v5/55/ea/c729936c292df58fba36c3ab995beb919370:
--------------------------------------------------------------------------------
1 |
2 | 4ca1a70bb5223ad95086d9d5d8df9432bc00fd9e469368a8a5515fb6b87457d9 {"key":"GET:http://jsonplaceholder.typicode.com/photos/1","integrity":"sha256-Dp3ZVHTx0q+3iKRejP9Tm4L714YY6ljgCoGDFP+pVTk=","time":1729918926720,"size":1211,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.cache/index-v5/5f/3b/9bca68df9ad96b96e0279b6cb9c27423df9d:
--------------------------------------------------------------------------------
1 |
2 | 5525e3e19d276c5f9490a19d2aea414ff5e432020efe61a971e196bd878b6183 {"key":"GET:http://jsonplaceholder.typicode.com/comments","integrity":"sha256-1ZlFPsRBt+1R+/QwsLVXQCXD0W7FSGFUJA1o8ed6f/0=","time":1729918925646,"size":41831,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.cache/index-v5/6b/2c/6e37b86a06ca566711c8721446f88a402f16:
--------------------------------------------------------------------------------
1 |
2 | ec5ec64e295520cd8a325e5ab24bd9d229c1bc33555a127b84a05302fcd1d8f7 {"key":"GET:http://jsonplaceholder.typicode.com/todos/1","integrity":"sha256-Gem2y7bSLS0hB0HxpKCYHQFN4hun0Zab1GwGhlVW+k0=","time":1729918927068,"size":1161,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.cache/index-v5/bf/06/5bc0932db3a16ea1d335c4d520f18e2383c5:
--------------------------------------------------------------------------------
1 |
2 | e677f1d2cb99d03c136ae0bbcb0270591aa2cda218f0415a3672c745ac11d09d {"key":"GET:https://api.deezer.com/playlist/908622995","integrity":"sha256-N/pOfkVlS5lMl31fbVO5h3rAvS2ZaCayr5DRZXVW6iQ=","time":1729918928659,"size":12598,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/.cache/index-v5/eb/cf/474593f41b0bd59755eec4d265aae630f8fb:
--------------------------------------------------------------------------------
1 |
2 | 0c35f4503eb3bbeead927304839254f130d16ac7be5cb843fe7e85d4e44ad498 {"key":"GET:http://jsonplaceholder.typicode.com/posts/1","integrity":"sha256-8Zu2600BElex5J0jr5Bs2TscP0cJICKnwEqGjXAlGMI=","time":1729918924754,"size":1292,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/docker.sh:
--------------------------------------------------------------------------------
1 | # Convert Cargo.toml to YAML
2 | yj -t < Cargo.toml > Cargo.yaml
3 |
4 | # Modify Cargo.yaml
5 | yq e 'del(.workspace.members[] | select(. == "cloudflare" or . == "autogen" or . == "testconv" or . == "aws-lambda"))' -i Cargo.yaml
6 |
7 | # Convert Cargo.yaml back to TOML
8 | yj -yt < Cargo.yaml > Cargo.toml
--------------------------------------------------------------------------------
/src/cli/llm/error.rs:
--------------------------------------------------------------------------------
1 | use derive_more::From;
2 | use strum_macros::Display;
3 |
4 | #[derive(Debug, From, Display, thiserror::Error)]
5 | pub enum Error {
6 | GenAI(genai::Error),
7 | EmptyResponse,
8 | Serde(serde_json::Error),
9 | }
10 |
11 | pub type Result = std::result::Result;
12 |
--------------------------------------------------------------------------------
/tailcall-tracker/src/collect/mod.rs:
--------------------------------------------------------------------------------
1 | use crate::Event;
2 |
3 | pub mod ga;
4 | pub mod posthog;
5 |
6 | ///
7 | /// Defines the interface for an event collector.
8 | #[async_trait::async_trait]
9 | pub trait Collect: Send + Sync {
10 | async fn collect(&self, event: Event) -> super::Result<()>;
11 | }
12 |
--------------------------------------------------------------------------------
/tests/core/snapshots/enum-args.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | enum COLOR {
7 | BLUE
8 | GREEN
9 | RED
10 | }
11 |
12 | type Query {
13 | color(item: COLOR): COLOR
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/federation-subgraph-force-disabled.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {}
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/core/snapshots/federation-subgraph-force-disabled.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {}
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/core/snapshots/federation-subgraph-force-enabled.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {}
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/core/snapshots/federation-subgraph-no-entities.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {}
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/core/snapshots/federation-subgraph-no-entities.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {}
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/core/snapshots/rest-api-error.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: Int!): User
8 | }
9 |
10 | type User {
11 | id: Int!
12 | name: String!
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/rest-api-post.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "id": 1,
13 | "name": "foo"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/rest-api-post.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: Int!): User
8 | }
9 |
10 | type User {
11 | id: Int!
12 | name: String!
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-on-response-body.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | hello: User!
8 | }
9 |
10 | type User {
11 | id: Int!
12 | name: String!
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-validation.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | scalar Email
7 |
8 | type Query {
9 | emailInput(x: Email!): Boolean
10 | emailOutput: Email!
11 | }
12 |
13 | schema {
14 | query: Query
15 | }
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-upstream-headers.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | ---
5 | type Post {
6 | id: Int
7 | }
8 |
9 | type Query {
10 | barField: String
11 | fooField: String
12 | posts: [Post]
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/upstream-batching.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: Int): User
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/execution/auth-protected-without-auth.md:
--------------------------------------------------------------------------------
1 | ---
2 | error: true
3 | ---
4 |
5 | # Using @protected operator without specifying server.auth config
6 |
7 | ```graphql @schema
8 | schema {
9 | query: Query
10 | }
11 |
12 | type Query {
13 | data: String @expr(body: "data") @protected
14 | }
15 | ```
16 |
--------------------------------------------------------------------------------
/tests/execution/undeclared-type-no-base-url.md:
--------------------------------------------------------------------------------
1 | ---
2 | error: true
3 | ---
4 |
5 | # undeclared-type-no-base-url
6 |
7 | ```graphql @schema
8 | schema @server {
9 | query: Query
10 | }
11 |
12 | type Query {
13 | users: [User] @http(url: "http://jsonplaceholder.typicode.com/users")
14 | }
15 | ```
16 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "semi": false,
3 | "singleQuote": false,
4 | "printWidth": 120,
5 | "tabWidth": 2,
6 | "bracketSpacing": false,
7 | "overrides": [
8 | {
9 | "files": ["devcontainer.json"],
10 | "options": {
11 | "trailingComma": "none"
12 | }
13 | }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/src/core/auth/error.rs:
--------------------------------------------------------------------------------
1 | #[derive(Debug, thiserror::Error, Clone, PartialEq, Eq, PartialOrd, Ord)]
2 | pub enum Error {
3 | #[error("Missing Authorization Header")]
4 | Missing,
5 |
6 | #[error("{0}")]
7 | Parse(String),
8 |
9 | #[error("Invalid Authorization Header")]
10 | Invalid,
11 | }
12 |
--------------------------------------------------------------------------------
/src/core/config/npo/fixtures/nested-resolvers.graphql:
--------------------------------------------------------------------------------
1 | schema @server @upstream {
2 | query: Query
3 | }
4 |
5 | type F1 {
6 | f2: [F2]
7 | }
8 |
9 | type F2 {
10 | f3: [F3]
11 | }
12 |
13 | type F3 {
14 | f4: String @http(url: "")
15 | }
16 |
17 | type Query {
18 | f1: [F1] @http(url: "")
19 | }
20 |
--------------------------------------------------------------------------------
/src/core/config/npo/fixtures/non-list-resolvers.graphql:
--------------------------------------------------------------------------------
1 | schema @server @upstream {
2 | query: Query
3 | }
4 |
5 | type F1 {
6 | f2: [F2]
7 | }
8 |
9 | type F2 {
10 | f3: [F3]
11 | }
12 |
13 | type F3 {
14 | f4: String @http(url: "")
15 | }
16 |
17 | type Query {
18 | f1: F1 @http(url: "")
19 | }
20 |
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/protobuf/news_no_service.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | import "google/protobuf/empty.proto";
4 |
5 | message News {
6 | int32 id = 1;
7 | string title = 2;
8 | string body = 3;
9 | string post_image = 4;
10 | }
11 |
12 | message NewsList {
13 | repeated News news = 1;
14 | }
--------------------------------------------------------------------------------
/tests/core/snapshots/add-field-index-list.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | username: String
8 | users: [User]
9 | }
10 |
11 | type User {
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-datasource-errors.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: Int): User
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-datasource-no-args.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | users_list: [User]
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/nullable-arg-query.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | users(id: ID): [User]
8 | }
9 |
10 | type User {
11 | id: ID!
12 | name: String!
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-add-link-to-empty-config.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | enum Foo {
7 | BAR
8 | BAZ
9 | }
10 |
11 | type Query {
12 | foo: Foo
13 | hello: String
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-null-in-array.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Company {
7 | id: ID
8 | name: String
9 | }
10 |
11 | type Query {
12 | hi(id: ID!): [Company]
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-null-in-object.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Company {
7 | id: ID
8 | name: String
9 | }
10 |
11 | type Query {
12 | hi(id: ID!): Company
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/.cache/index-v5/c9/d8/5c58e5e52bd5fa5171267a33b5116be81480:
--------------------------------------------------------------------------------
1 |
2 | 5583f421fcb4a663df8193db18a94606535c280fec869e92188482d5eec29d6c {"key":"GET:http://jsonplaceholder.typicode.com/comments?postId=1","integrity":"sha256-WTZWBzJdOdkLP+CVFajHalI/gXaa1JNSAGLLthf9/yY=","time":1729918927233,"size":1765,"metadata":null,"raw_metadata":null}
--------------------------------------------------------------------------------
/benches/grpc/dummy.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package dummy;
4 |
5 | message Dummy {
6 | repeated int32 ints = 1;
7 | repeated bool flags = 2;
8 | repeated string names = 3;
9 | repeated float floats = 4;
10 | }
11 |
12 | service DummyService {
13 | rpc GetDummy(Dummy) returns (Dummy) {}
14 | }
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-datasource-query-directives.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user: User
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/request-to-upstream-batching.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: Int!): User
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/routes-param-on-server-directive.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "message": "ready"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-enum.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "foo": "BAR"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-enum.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "foo": "BAZ"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/execution/test-expr-error.md:
--------------------------------------------------------------------------------
1 | ---
2 | error: true
3 | ---
4 |
5 | # test-expr-error
6 |
7 | ```graphql @schema
8 | schema @server {
9 | query: Query
10 | }
11 |
12 | type User {
13 | name: String
14 | age: Int!
15 | }
16 |
17 | type Query {
18 | user: User @expr(body: {name: "John"})
19 | }
20 | ```
21 |
--------------------------------------------------------------------------------
/tests/execution/test-http-headers.md:
--------------------------------------------------------------------------------
1 | ---
2 | identity: true
3 | ---
4 |
5 | # test-http-headers
6 |
7 | ```graphql @schema
8 | schema @server @upstream {
9 | query: Query
10 | }
11 |
12 | type Query {
13 | foo: String @http(url: "http://localhost:4000/foo", headers: [{key: "foo", value: "bar"}])
14 | }
15 | ```
16 |
--------------------------------------------------------------------------------
/tests/execution/test-merge-server-sdl.md:
--------------------------------------------------------------------------------
1 | # test-merge-server-sdl
2 |
3 | ```graphql @schema
4 | schema @server {
5 | query: Query
6 | }
7 |
8 | type Query {
9 | foo: [User] @http(url: "http://jsonplaceholder.typicode.com/users")
10 | }
11 |
12 | type User {
13 | id: Int
14 | name: String
15 | }
16 | ```
17 |
--------------------------------------------------------------------------------
/tests/server/config/server-start-http2-ec.graphql:
--------------------------------------------------------------------------------
1 | schema
2 | @server(port: 8804, version: HTTP2, hostname: "localhost")
3 | @link(type: Cert, src: "./example.crt")
4 | @link(type: Key, src: "./example-ec.key") {
5 | query: Query
6 | }
7 |
8 | type Query {
9 | greet: String @expr(body: "Hello World!")
10 | }
11 |
--------------------------------------------------------------------------------
/src/core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__multiple_type_usage.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/npo/tracker.rs
3 | expression: actual
4 | snapshot_kind: text
5 | ---
6 | query { t2 { t2 { n } } }
7 | query { t2_ls { t2 } }
8 | query { t3 { t3 { n } } }
9 | query { t3_ls { t3 { n } } }
10 |
--------------------------------------------------------------------------------
/src/core/data_loader/mod.rs:
--------------------------------------------------------------------------------
1 | mod cache;
2 | mod data_loader;
3 | mod dedupe;
4 | mod factory;
5 | mod loader;
6 | mod storage;
7 |
8 | // Making public as it is unused and clippy gives warning.
9 | pub use cache::LruCache;
10 | pub use data_loader::DataLoader;
11 | pub use dedupe::DedupeResult;
12 | pub use loader::Loader;
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/default-value-arg.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "bar": 1
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/default-value-arg.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "bar": 2
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/enum-args.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "color": "RED"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/federation-subgraph-no-entities.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: Int!): User
8 | }
9 |
10 | type User {
11 | id: Int!
12 | name: String!
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/inline-many-list.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | u: U
8 | }
9 |
10 | type U {
11 | b: [String]
12 | c: String
13 | d: String
14 | e: String
15 | }
16 |
17 | schema {
18 | query: Query
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/introspection-query-with-disabled-introspection.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {}
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-expr.md_merged.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatter
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream @link(src: "schema_0.graphql", type: Config) {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | hello: String @expr(body: "Hello from server")
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars.md_5.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "bytes": "test"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/undeclared-type.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Undeclared type 'User' was found",
9 | "trace": [
10 | "Query",
11 | "users"
12 | ],
13 | "description": null
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/tests/execution/test-custom-scalar.md:
--------------------------------------------------------------------------------
1 | ---
2 | identity: true
3 | ---
4 |
5 | # test-custom-scalar
6 |
7 | ```graphql @schema
8 | schema @server @upstream {
9 | query: Query
10 | }
11 |
12 | scalar Json
13 |
14 | type Query {
15 | foo: [Json] @http(url: "http://jsonplacheholder.typicode.com/foo")
16 | }
17 | ```
18 |
--------------------------------------------------------------------------------
/tests/execution/test-http-baseurl.md:
--------------------------------------------------------------------------------
1 | ---
2 | identity: true
3 | ---
4 |
5 | # test-http-url
6 |
7 | ```graphql @schema
8 | schema @server @upstream {
9 | query: Query
10 | }
11 |
12 | type Query {
13 | bar: String @http(url: "http://abc.com/bar")
14 | foo: String @http(url: "http://foo.com/foo")
15 | }
16 | ```
17 |
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/protobuf/greetings_b.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package greetings_b.c;
4 |
5 | import "greetings_message.proto";
6 |
7 | // The greeter service definition.
8 | service Greeter {
9 | // Sends a greeting
10 | rpc SayHello (greetings.HelloRequest) returns (greetings.HelloReply) {}
11 | }
12 |
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/protobuf/map.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package map;
4 |
5 | message MapRequest {
6 | map map = 1;
7 | }
8 |
9 | message MapResponse {
10 | map map = 1;
11 | }
12 |
13 | service MapService {
14 | rpc GetMap (MapRequest) returns (MapResponse) {}
15 | }
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/apollo-tracing.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "hello": "hello"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/apollo-tracing.md_merged.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatter
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream @link(src: "schema_0.graphql", type: Config) {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | hello: String! @http(url: "http://api.com/")
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/auth-multiple.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a_and_b": "data"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/auth-multiple.md_5.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "b_and_c": "data"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/auth-multiple.md_6.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "c_and_a": "data"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/federation-subgraph-force-disabled.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: Int!): User
8 | }
9 |
10 | type User {
11 | id: Int!
12 | name: String!
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/omit-many.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user: User
8 | }
9 |
10 | type User {
11 | complements: [String]
12 | name: String
13 | zipcode: String
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-enum-aliases.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "foo": "BAR"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-null-in-array.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "hi": null
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-null-in-object.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "hi": null
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-params-as-body.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | firstUser(id: Int, name: String): User
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-union-optional.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "node": null
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/server/config/server-start-http2-nokey.graphql:
--------------------------------------------------------------------------------
1 | schema
2 | @server(port: 8803, version: HTTP2, hostname: "localhost")
3 | @link(type: Cert, src: "./example.crt")
4 | @link(type: Key, src: "./example-nokey.key") {
5 | query: Query
6 | }
7 |
8 | type Query {
9 | greet: String @expr(body: "Hello World!")
10 | }
11 |
--------------------------------------------------------------------------------
/tests/server/config/server-start-http2-pkcs8.graphql:
--------------------------------------------------------------------------------
1 | schema
2 | @server(port: 8801, version: HTTP2, hostname: "localhost")
3 | @link(type: Cert, src: "./example.crt")
4 | @link(type: Key, src: "./example-pkcs8.key") {
5 | query: Query
6 | }
7 |
8 | type Query {
9 | greet: String @expr(body: "Hello World!")
10 | }
11 |
--------------------------------------------------------------------------------
/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__enums_invalid.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/config_module/merge.rs
3 | expression: merged.unwrap_err()
4 | snapshot_kind: text
5 | ---
6 | Validation Error
7 | • Enum is used as input type in one subgraph and output type in another [enumOutput]
8 |
--------------------------------------------------------------------------------
/tests/core/snapshots/batching-disabled.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: Int!): User
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | username: String
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/call-multiple-steps-piping.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "abc": 3
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/content-type-graphql.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: ID!): User!
8 | }
9 |
10 | type User {
11 | city: String
12 | id: ID!
13 | name: String!
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-001.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: ID!): User!
8 | }
9 |
10 | type User {
11 | city: String
12 | id: ID!
13 | name: String!
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-014.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: ID!): User!
8 | }
9 |
10 | type User {
11 | city: String
12 | id: ID!
13 | name: String!
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-enum-description.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "foo": "BAR"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-enum-description.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "foo": "BAZ"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-js-multiple-scripts.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Only one script link is allowed",
9 | "trace": [
10 | "schema",
11 | "@link"
12 | ],
13 | "description": null
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-merge-invalid.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Type mismatch: expected `String`, got `Int`",
9 | "trace": [
10 | "Foo",
11 | "a"
12 | ],
13 | "description": null
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_call.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/transformer/subgraph.rs
3 | expression: keys
4 | snapshot_kind: text
5 | ---
6 | Valid(
7 | Ok(
8 | Some(
9 | "arg { a b }",
10 | ),
11 | ),
12 | )
13 |
--------------------------------------------------------------------------------
/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_expr.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/transformer/subgraph.rs
3 | expression: keys
4 | snapshot_kind: text
5 | ---
6 | Valid(
7 | Ok(
8 | Some(
9 | "body { a b }",
10 | ),
11 | ),
12 | )
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/add-field-with-composition.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "lng": "81.1496"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/call-multiple-steps-piping.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "abc_input": 3
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/default-value-config.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | input Input {
7 | id: Int = 1
8 | }
9 |
10 | type Query {
11 | bar(input: Input = {id: 3}): Int
12 | foo(input: Input!): Int
13 | }
14 |
15 | schema {
16 | query: Query
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-018.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: ID!): User!
8 | }
9 |
10 | type User {
11 | city: String
12 | id: ID!
13 | newName: String!
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-http-001.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: ID!): User!
8 | }
9 |
10 | type User {
11 | city: String
12 | id: ID!
13 | name: String!
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-http-005.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: ID!): User!
8 | }
9 |
10 | type User {
11 | dob: String!
12 | id: ID!
13 | name: String!
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-http-014.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: ID!): User!
8 | }
9 |
10 | type User {
11 | city: String
12 | id: ID!
13 | name: String!
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/omit-index-list.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "username": "Leanne Graham"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-enum-empty.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": " --> 9:11\n |\n9 | enum Foo {}\n | ^---\n |\n = expected enum_value_definition",
9 | "trace": [],
10 | "description": null
11 | }
12 | ]
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-grpc-group-by.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "field id not found",
9 | "trace": [
10 | "Query",
11 | "newsById",
12 | "@grpc"
13 | ],
14 | "description": null
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-lack-resolver.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "No resolver has been found in the schema",
9 | "trace": [
10 | "Query",
11 | "posts"
12 | ],
13 | "description": null
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-required-fields.md_11.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "innerMissing": null
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-required-fields.md_19.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "noneMissing": null
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-required-fields.md_5.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "relaxedMissing": null
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-validation.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "emailInput": 123
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "email": "hello@valid.com"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "phone": "+1 (614) 1234567"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars.md_3.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "url": "https://tailcall.run/"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/undeclared-type-no-base-url.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Undeclared type 'User' was found",
9 | "trace": [
10 | "Query",
11 | "users"
12 | ],
13 | "description": null
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/ci-benchmark/sample-wrk-output.txt:
--------------------------------------------------------------------------------
1 | Running 30s test @ http://localhost:8000/graphql
2 | 4 threads and 100 connections
3 | Thread Stats Avg Stdev Max +/- Stdev
4 | Latency 6.70ms 1.90ms 36.72ms 71.69%
5 | Req/Sec 3.75k 157.32 4.11k 80.83%
6 | 448482 requests in 30.01s, 2.25GB read
7 | Requests/sec: 14941.99
--------------------------------------------------------------------------------
/src/cli/llm/prompts/infer_type_name.md:
--------------------------------------------------------------------------------
1 | Given the sample schema of a GraphQL type, suggest 5 meaningful names for it.
2 | The name should be concise, preferably a single word and must not be in the `ignore` list.
3 |
4 | Example Input:
5 | {{input}}
6 |
7 | Example Output:
8 | {{output}}
9 |
10 | Ensure the output is in valid JSON format.
11 |
--------------------------------------------------------------------------------
/tests/core/snapshots/add-field-index-list.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "username": "Leanne Graham"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/add-field-with-composition.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "lat": "-37.3159"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/add-field-with-modify.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user1": "Leanne Graham"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/add-field-with-modify.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user2": "Ervin Howell"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/async-cache-global.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Post {
7 | body: String
8 | id: Int
9 | title: String
10 | userId: Int!
11 | }
12 |
13 | type Query {
14 | posts: [Post]
15 | }
16 |
17 | schema {
18 | query: Query
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/caching-collision.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Bar {
7 | foo: Foo
8 | id: String!
9 | }
10 |
11 | type Foo {
12 | id: Int!
13 | }
14 |
15 | type Query {
16 | bars: [Bar]
17 | }
18 |
19 | schema {
20 | query: Query
21 | }
22 |
--------------------------------------------------------------------------------
/tests/core/snapshots/inline-index-list.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "username": "Leanne Graham"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/inline-many.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user: User
8 | }
9 |
10 | type User {
11 | city: String
12 | name: String
13 | street: String
14 | zipcode: String
15 | }
16 |
17 | schema {
18 | query: Query
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/recursive-types-no-resolver.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "No resolver has been found in the schema",
9 | "trace": [
10 | "Query",
11 | "user"
12 | ],
13 | "description": null
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/resolve-with-headers.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Post {
7 | body: String!
8 | id: ID!
9 | title: String!
10 | userId: ID!
11 | }
12 |
13 | type Query {
14 | post1: Post
15 | }
16 |
17 | schema {
18 | query: Query
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-grpc-service-method.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Couldn't find method X",
9 | "trace": [
10 | "Query",
11 | "news",
12 | "@grpc"
13 | ],
14 | "description": null
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-no-base-url.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": " --> 10:20\n |\n10 | user: User @http()\n | ^---\n |\n = expected name",
9 | "trace": [],
10 | "description": null
11 | }
12 | ]
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-query.md_merged.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatter
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream @link(src: "schema_0.graphql", type: Config) {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | foo: String @http(url: "http://jsonplaceholder.typicode.com/foo")
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars.md_2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "date": "2023-03-08T12:45:26-05:00"
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/server/config/server-start-http2-rsa.graphql:
--------------------------------------------------------------------------------
1 | schema
2 | @server(port: 8802, version: HTTP2, hostname: "localhost", batchRequests: true)
3 | @link(type: Cert, src: "./example.crt")
4 | @link(type: Key, src: "./example-rsa.key") {
5 | query: Query
6 | }
7 |
8 | type Query {
9 | greet: String @expr(body: "Hello World!")
10 | }
11 |
--------------------------------------------------------------------------------
/tests/snapshots/jit_spec__tests__executor_arguments_default_value.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/jit_spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "data": {
8 | "post": {
9 | "id": 1,
10 | "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit"
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/project-words.txt:
--------------------------------------------------------------------------------
1 | btreemap
2 | datatest
3 | entr
4 | genai
5 | Hasher
6 | Htpasswd
7 | httpmock
8 | indexmap
9 | inlines
10 | insta
11 | jsonplaceholder
12 | Jwks
13 | machineid
14 | maplit
15 | mdast
16 | multispace
17 | opentelemetry
18 | peekable
19 | posthog
20 | schemars
21 | sysinfo
22 | tailcall
23 | tailcallrc
24 | thiserror
25 | tupled
26 |
--------------------------------------------------------------------------------
/src/cli/tc/gen.rs:
--------------------------------------------------------------------------------
1 | use anyhow::Result;
2 |
3 | use crate::cli::generator::Generator;
4 | use crate::core::runtime::TargetRuntime;
5 |
6 | pub(super) async fn gen_command(file_path: &str, runtime: TargetRuntime) -> Result<()> {
7 | Generator::new(file_path, runtime.clone())
8 | .generate()
9 | .await?;
10 | Ok(())
11 | }
12 |
--------------------------------------------------------------------------------
/src/core/generator/tests/snapshots/json_to_config_spec__empty_list.json.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/generator/tests/json_to_config_spec.rs
3 | expression: cfg.to_sdl()
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | users: [JSON] @http(url: "https://example.com/users")
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/batching.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "id": 1
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-nested-lists.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "addUsers": true
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/ref-other.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | firstUser: User1
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | type User1 {
16 | user1: User
17 | }
18 |
19 | schema {
20 | query: Query
21 | }
22 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-enum-description.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | """
7 | Description of enum Foo
8 | """
9 | enum Foo {
10 | BAR
11 | BAZ
12 | }
13 |
14 | type Query {
15 | foo(val: String!): Foo
16 | }
17 |
18 | schema {
19 | query: Query
20 | }
21 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-ref-other.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type InPost {
7 | get: [Post]
8 | }
9 |
10 | type Post {
11 | id: Int!
12 | userId: Int!
13 | }
14 |
15 | type Query {
16 | posts: InPost
17 | }
18 |
19 | schema {
20 | query: Query
21 | }
22 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-builtin.md_3.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": true,
14 | "b": false
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-builtin.md_6.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": true,
14 | "b": "str"
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-builtin.md_7.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": true,
14 | "b": 123
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-builtin.md_8.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": true,
14 | "b": 0
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-builtin.md_9.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": true,
14 | "b": 1.25
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-integers.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": -125,
14 | "b": 120
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-integers.md_5.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": 0,
14 | "b": 255
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/execution/test-http.md:
--------------------------------------------------------------------------------
1 | ---
2 | identity: true
3 | ---
4 |
5 | # test-http
6 |
7 | ```graphql @schema
8 | schema @server @upstream {
9 | query: Query
10 | }
11 |
12 | type Query {
13 | foo: [User] @http(url: "http://jsonplaceholder.typicode.com/users")
14 | }
15 |
16 | type User {
17 | id: Int
18 | name: String
19 | }
20 | ```
21 |
--------------------------------------------------------------------------------
/tests/snapshots/jit_spec__tests__query_alias.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/jit_spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "data": {
8 | "user1": {
9 | "id": 1,
10 | "name": "Leanne Graham"
11 | },
12 | "user2": {
13 | "id": 2,
14 | "name": "Ervin Howell"
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_graphql.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/transformer/subgraph.rs
3 | expression: keys
4 | snapshot_kind: text
5 | ---
6 | Valid(
7 | Ok(
8 | Some(
9 | "header_test input { key }",
10 | ),
11 | ),
12 | )
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/add-field-with-modify.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | person1: User
8 | person2: User
9 | user1: String
10 | user2: String
11 | }
12 |
13 | type User {
14 | name: String
15 | }
16 |
17 | schema {
18 | query: Query
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/caching.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "fieldCache": {
14 | "id": 1
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/dedupe_batch_query_execution.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Post {
7 | body: String
8 | id: Int
9 | title: String
10 | userId: Int!
11 | }
12 |
13 | type Query {
14 | posts: [Post]
15 | }
16 |
17 | schema {
18 | query: Query
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-013.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | scalar Date
7 |
8 | type Query {
9 | me: User!
10 | }
11 |
12 | type User {
13 | birthday: Date
14 | id: String
15 | name: String
16 | }
17 |
18 | schema {
19 | query: Query
20 | }
21 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-nested-lists-http.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "addUsers": true
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/grpc-json.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "newsById": {
14 | "id": 2
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/on-response-body-grpc.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type News {
7 | body: String
8 | id: Int
9 | postImage: String
10 | title: String
11 | }
12 |
13 | type Query {
14 | newsById: News!
15 | }
16 |
17 | schema {
18 | query: Query
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/showcase.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "name": "foo"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-interface.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type B implements IA {
7 | a: String
8 | b: String
9 | }
10 |
11 | interface IA {
12 | a: String
13 | }
14 |
15 | type Query {
16 | bar: B
17 | }
18 |
19 | schema {
20 | query: Query
21 | }
22 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-link-support.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type News {
7 | id: Int
8 | }
9 |
10 | input NewsInput {
11 | id: Int
12 | }
13 |
14 | type Query {
15 | newsById(news: NewsInput!): News!
16 | }
17 |
18 | schema {
19 | query: Query
20 | }
21 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-builtin.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": 2485165,
14 | "b": -543521
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-builtin.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": 1.256,
14 | "b": -15651
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-builtin.md_2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": "str",
14 | "b": 15616
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-builtin.md_4.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": "test-id",
14 | "b": 123
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-builtin.md_5.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": 2485165,
14 | "b": "str"
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-integers.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": -1250,
14 | "b": 32767
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-integers.md_6.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": 32767,
14 | "b": 63535
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/execution/test-query-documentation.md:
--------------------------------------------------------------------------------
1 | ---
2 | identity: true
3 | ---
4 |
5 | # test-query-documentation
6 |
7 | ```graphql @schema
8 | schema @server @upstream {
9 | query: Query
10 | }
11 |
12 | type Query {
13 | """
14 | This is test
15 | """
16 | foo: String @http(url: "http://jsonplaceholder.typicode.com/foo")
17 | }
18 | ```
19 |
--------------------------------------------------------------------------------
/src/cli/llm/snapshots/tailcall__cli__llm__infer_type_name__test__chat_response_parse.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/cli/llm/infer_type_name.rs
3 | expression: answer
4 | snapshot_kind: text
5 | ---
6 | Answer {
7 | suggestions: [
8 | "Post",
9 | "Story",
10 | "Article",
11 | "Event",
12 | "Brief",
13 | ],
14 | }
15 |
--------------------------------------------------------------------------------
/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_grpc.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/transformer/subgraph.rs
3 | expression: keys
4 | snapshot_kind: text
5 | ---
6 | Valid(
7 | Ok(
8 | Some(
9 | "body { a b } header_test method",
10 | ),
11 | ),
12 | )
13 |
--------------------------------------------------------------------------------
/src/core/generator/tests/snapshots/json_to_config_spec__list_primitive_type.json.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/generator/tests/json_to_config_spec.rs
3 | expression: cfg.to_sdl()
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | users: [String] @http(url: "https://example.com/users")
12 | }
13 |
--------------------------------------------------------------------------------
/src/core/generator/tests/snapshots/json_to_config_spec__string.json.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/generator/tests/json_to_config_spec.rs
3 | expression: cfg.to_sdl()
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | loginStatus: String @http(url: "https://example.com/login/status")
12 | }
13 |
--------------------------------------------------------------------------------
/tailcall-prettier/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "tailcall-prettier"
3 | version = "0.1.0"
4 | edition = "2021"
5 |
6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7 |
8 | [dependencies]
9 | lazy_static = "1.4.0"
10 | strum_macros = "0.26.2"
11 | thiserror.workspace = true
12 | tokio.workspace = true
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/add-field.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "lat": "-37.3159"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-http-013.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | scalar Date
7 |
8 | type Query {
9 | me: User!
10 | }
11 |
12 | type User {
13 | birthday: Date
14 | id: String
15 | name: String
16 | }
17 |
18 | schema {
19 | query: Query
20 | }
21 |
--------------------------------------------------------------------------------
/tests/core/snapshots/grpc-proto-with-same-package.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Bar {
7 | bar: String
8 | }
9 |
10 | type Foo {
11 | foo: String
12 | }
13 |
14 | type Query {
15 | bar: Bar!
16 | foo: Foo!
17 | }
18 |
19 | schema {
20 | query: Query
21 | }
22 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-interface-result.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type B implements IA {
7 | a: String
8 | b: String
9 | }
10 |
11 | interface IA {
12 | a: String
13 | }
14 |
15 | type Query {
16 | bar: IA
17 | }
18 |
19 | schema {
20 | query: Query
21 | }
22 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-missing-mutation-resolver.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "No resolver has been found in the schema",
9 | "trace": [
10 | "Mutation",
11 | "createUser"
12 | ],
13 | "description": null
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-integers.md_2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": -125,
14 | "b": 2147483645
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-integers.md_7.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "a": 65535,
14 | "b": 4294967295
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-union.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "foo": {
14 | "foo": "test-foo"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-union.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "bar": {
14 | "bar": "test-bar"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/with-args-url.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "name": "foo"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/core/config/config_module/snapshots/tailcall__core__config__config_module__merge__tests__types_invalid.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/config_module/merge.rs
3 | expression: merged.unwrap_err()
4 | snapshot_kind: text
5 | ---
6 | Validation Error
7 | • Type mismatch: expected `String`, got `Int` [A, a]
8 | • Type mismatch: expected list, got singular value [A, b]
9 |
--------------------------------------------------------------------------------
/src/core/has_headers.rs:
--------------------------------------------------------------------------------
1 | use http::header::HeaderMap;
2 |
3 | use crate::core::ir::{EvalContext, ResolverContextLike};
4 |
5 | pub trait HasHeaders {
6 | fn headers(&self) -> &HeaderMap;
7 | }
8 |
9 | impl HasHeaders for EvalContext<'_, Ctx> {
10 | fn headers(&self) -> &HeaderMap {
11 | self.headers()
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/tests/core/snapshots/grpc-json.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "newsByIdMustache": {
14 | "id": 2
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/mutation-put.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "insertPost": {
14 | "body": "abc"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/simple-graphql.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "name": "foo"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/simple-query.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "firstUser": {
14 | "name": "foo"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-add-field.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type A {
7 | b: B
8 | }
9 |
10 | type B {
11 | c: String
12 | }
13 |
14 | type Foo {
15 | a: A
16 | }
17 |
18 | type Query {
19 | b: B
20 | foo: Foo
21 | }
22 |
23 | schema {
24 | query: Query
25 | }
26 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-expr-error.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "expected field to be non-nullable",
9 | "trace": [
10 | "Query",
11 | "user",
12 | "@expr",
13 | "age"
14 | ],
15 | "description": null
16 | }
17 | ]
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-merge-nested.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Foo {
7 | """
8 | test2
9 | """
10 | a: String
11 | """
12 | test1
13 | """
14 | b: String
15 | }
16 |
17 | type Query {
18 | hi: Foo
19 | }
20 |
21 | schema {
22 | query: Query
23 | }
24 |
--------------------------------------------------------------------------------
/src/core/config/transformer/fixtures/union.graphql:
--------------------------------------------------------------------------------
1 | schema {
2 | query: Query
3 | }
4 |
5 | type T1 {
6 | t1: String
7 | }
8 |
9 | type T2 {
10 | t2: Int
11 | }
12 |
13 | type T3 {
14 | t3: Boolean
15 | t33: Float!
16 | }
17 |
18 | union U = T1 | T2 | T3
19 |
20 | type Query {
21 | test(u: U!): U @http(url: "http://localhost/users/{{args.u}}")
22 | }
23 |
--------------------------------------------------------------------------------
/tests/core/snapshots/env-value.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Post {
7 | body: String
8 | id: Int
9 | title: String
10 | userId: Int!
11 | }
12 |
13 | type Query {
14 | post1: Post
15 | post2: Post
16 | post3: Post
17 | }
18 |
19 | schema {
20 | query: Query
21 | }
22 |
--------------------------------------------------------------------------------
/tests/core/snapshots/grpc-json.md_2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "newsByIdMustacheAndJson": {
14 | "id": 2
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/inline-field.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "address": "-37.3159"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/js-directive.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "hello": {
14 | "name": "LEANNE GRAHAM"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/mutation.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "insertPost": {
14 | "body": "post-body"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/rename-field.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user1": {
14 | "name": "Leanne Graham"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/rename-field.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user2": {
14 | "name": "Ervin Howell"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-batch-operator-post.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "batchKey requires either body or query parameters",
9 | "trace": [
10 | "Query",
11 | "user",
12 | "@http"
13 | ],
14 | "description": null
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-description-many.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Bar {
7 | """
8 | This is test2
9 | """
10 | baz: String
11 | }
12 |
13 | type Query {
14 | """
15 | This is test
16 | """
17 | foo: Bar
18 | }
19 |
20 | schema {
21 | query: Query
22 | }
23 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-grpc-invalid-proto-id.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Protobuf files were not specified in the config",
9 | "trace": [
10 | "Query",
11 | "news",
12 | "@grpc"
13 | ],
14 | "description": null
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-invalid-server.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Parsing failed because of invalid type: string \"8000\", expected u16",
9 | "trace": [
10 | "@server",
11 | "port"
12 | ],
13 | "description": null
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-nested-value.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Post {
7 | id: Int
8 | user: User!
9 | }
10 |
11 | type Query {
12 | posts: [Post]
13 | }
14 |
15 | type User {
16 | id: Int!
17 | name: String
18 | }
19 |
20 | schema {
21 | query: Query
22 | }
23 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-optional-key-skip-empty.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Bar {
7 | id: Int
8 | }
9 |
10 | type Foo {
11 | bar: Bar
12 | id: Int!
13 | tag: String
14 | }
15 |
16 | type Query {
17 | foos: [Foo]
18 | }
19 |
20 | schema {
21 | query: Query
22 | }
23 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars-builtin.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | bool(x: Boolean!): Boolean!
8 | float(x: Float!): Float!
9 | id(x: ID!): ID
10 | int(x: Int!): Int!
11 | string(x: String!): String!
12 | }
13 |
14 | schema {
15 | query: Query
16 | }
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-union-ambiguous.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "foo": {
14 | "foo": "test-foo"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-union-ambiguous.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "bar": {
14 | "bar": "test-bar"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-union-ambiguous.md_4.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "unknown": {
14 | "bar": null
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-union-fieldtype.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "foo": {
14 | "foo": "test-foo"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-union-fieldtype.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "bar": {
14 | "bar": "test-bar"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/execution/test-modify.md:
--------------------------------------------------------------------------------
1 | ---
2 | identity: true
3 | ---
4 |
5 | # test-modify
6 |
7 | ```graphql @schema
8 | schema @server @upstream {
9 | query: Query
10 | }
11 |
12 | input Foo {
13 | bar: String
14 | }
15 |
16 | type Query {
17 | foo(input: Foo): String @http(url: "http://jsonplaceholder.typicode.com/foo") @modify(name: "data")
18 | }
19 | ```
20 |
--------------------------------------------------------------------------------
/src/core/config/transformer/snapshots/tailcall__core__config__transformer__subgraph__tests__extractor__extract_http.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/transformer/subgraph.rs
3 | expression: keys
4 | snapshot_kind: text
5 | ---
6 | Valid(
7 | Ok(
8 | Some(
9 | "header { key value } id obj query_key query_value",
10 | ),
11 | ),
12 | )
13 |
--------------------------------------------------------------------------------
/src/core/generator/tests/snapshots/json_to_config_spec__incompatible_root_object.json.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/generator/tests/json_to_config_spec.rs
3 | expression: cfg.to_sdl()
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | inCompatibleRootObject: JSON @http(url: "https://example.com/")
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/call-mutation.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "insertPost": {
14 | "body": "post-body"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/introspection-query-with-disabled-introspection.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | scalar Date
7 |
8 | type Query {
9 | me: User!
10 | }
11 |
12 | type User {
13 | birthday: Date
14 | id: String
15 | name: String
16 | }
17 |
18 | schema {
19 | query: Query
20 | }
21 |
--------------------------------------------------------------------------------
/tests/core/snapshots/modified-field.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "fullname": "Leanne Graham"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-add-field-list.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type A {
7 | b: B
8 | }
9 |
10 | type B {
11 | c: String
12 | }
13 |
14 | type Foo {
15 | a: A
16 | }
17 |
18 | type Query {
19 | b: B
20 | foo: [Foo]
21 | }
22 |
23 | schema {
24 | query: Query
25 | }
26 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-enum-as-argument.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: Int!, test: Test): User
8 | }
9 |
10 | enum Test {
11 | A
12 | B
13 | }
14 |
15 | type User {
16 | id: Int!
17 | name: String!
18 | }
19 |
20 | schema {
21 | query: Query
22 | }
23 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-graphqlsource-no-base-url.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Parsing failed because of missing field `url`",
9 | "trace": [
10 | "Post",
11 | "user",
12 | "@graphQL"
13 | ],
14 | "description": null
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-grpc-service.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Couldn't find definitions for service news.YourServiceName",
9 | "trace": [
10 | "Query",
11 | "news",
12 | "@grpc"
13 | ],
14 | "description": null
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-input-out.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | input Filter {
7 | a: Int
8 | }
9 |
10 | type MyType {
11 | id: String!
12 | name: String
13 | }
14 |
15 | type Query {
16 | queryTest(filter: Filter): [MyType]
17 | }
18 |
19 | schema {
20 | query: Query
21 | }
22 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-js-request-response.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "hello": "hello world",
14 | "hi": "bye world"
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-union-ambiguous.md_5.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "wrong": {
14 | "__typename": "Baz"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/execution/test-missing-query-resolver.md:
--------------------------------------------------------------------------------
1 | ---
2 | error: true
3 | ---
4 |
5 | # test-missing-query-resolver
6 |
7 | ```graphql @schema
8 | schema {
9 | query: Query
10 | }
11 |
12 | type Query {
13 | user: [User]
14 | posts: [Post]!
15 | }
16 |
17 | type User {
18 | id: ID
19 | name: String
20 | }
21 |
22 | type Post {
23 | id: ID
24 | }
25 | ```
26 |
--------------------------------------------------------------------------------
/examples/scripts/echo.js:
--------------------------------------------------------------------------------
1 | function onRequest({request}) {
2 | return {request}
3 | }
4 |
5 | function hello(val) {
6 | let json = JSON.parse(val)
7 | return JSON.stringify(json.id)
8 | }
9 |
10 | function onResponse(response) {
11 | const parsedValue = JSON.parse(response)
12 | parsedValue.name += " - modified by JS"
13 | return JSON.stringify(parsedValue)
14 | }
15 |
--------------------------------------------------------------------------------
/src/core/config/transformer/merge_types/snapshots/tailcall__core__config__transformer__merge_types__type_merger__test__interface_types.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/transformer/merge_types/type_merger.rs
3 | expression: config.to_sdl()
4 | snapshot_kind: text
5 | ---
6 | interface GEN__M1 {
7 | a: Int
8 | }
9 |
10 | type C implements GEN__M1 {
11 | a: Int
12 | }
13 |
--------------------------------------------------------------------------------
/src/core/config/transformer/snapshots/tailcall__core__config__transformer__nested_unions__tests__nested_unions_recursive.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/config/transformer/nested_unions.rs
3 | expression: error
4 | snapshot_kind: text
5 | ---
6 | Validation Error
7 | • Recursive type U1 [U]
8 | • Recursive type U2 [U]
9 | • Recursive type U2 [U1]
10 | • Recursive type U1 [U2]
11 |
--------------------------------------------------------------------------------
/src/core/rest/mod.rs:
--------------------------------------------------------------------------------
1 | mod directive;
2 | mod endpoint;
3 | mod endpoint_set;
4 | pub mod error;
5 | mod operation;
6 | mod partial_request;
7 | mod path;
8 | mod query_params;
9 | mod type_map;
10 | mod typed_variables;
11 |
12 | pub use endpoint_set::{Checked, EndpointSet, Unchecked};
13 |
14 | type Request = http::Request;
15 | pub use error::{Error, Result};
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/call-mutation.md_2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "attachPostToFirstUser": {
14 | "name": "foo"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/call-mutation.md_4.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "insertMockedPost": {
14 | "body": "post-body"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-003.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: ID!): User!
8 | }
9 |
10 | type User {
11 | id: ID!
12 | name: String!
13 | profilePic(size: Int, width: Int, height: Int): String!
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-datasource-query-directives.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "id": 123
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/jit-enum-array.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type DTA {
7 | departments: [Department]
8 | }
9 |
10 | enum Department {
11 | BLUE
12 | ENGINEERING
13 | MARKETING
14 | }
15 |
16 | type Query {
17 | color: DTA
18 | }
19 |
20 | schema {
21 | query: Query
22 | }
23 |
--------------------------------------------------------------------------------
/tests/core/snapshots/resolve-with-headers.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "post1": {
14 | "title": "post title"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/resolved-by-parent.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "address": "Kulas Light"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-add-field-error.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Cannot add field",
9 | "trace": [
10 | "Query",
11 | "@addField",
12 | "street"
13 | ],
14 | "description": "Path [user, address, street] does not exist"
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-custom-scalar.md_merged.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatter
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream @link(src: "schema_0.graphql", type: Config) {
7 | query: Query
8 | }
9 |
10 | scalar Json
11 |
12 | type Query {
13 | foo: [Json] @http(url: "http://jsonplacheholder.typicode.com/foo")
14 | }
15 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-discriminator-invalid.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "The `field` cannot be an empty string for the `@discriminate` of type FooBar",
9 | "trace": [
10 | "Query",
11 | "foo"
12 | ],
13 | "description": null
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-enum-as-argument.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "name": "Json Schema"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-enum.md_merged.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatter
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream @link(src: "schema_0.graphql", type: Config) {
7 | query: Query
8 | }
9 |
10 | enum Foo {
11 | BAR
12 | BAZ
13 | }
14 |
15 | type Query {
16 | foo(val: String!): Foo @expr(body: "{{.args.val}}")
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-expr-with-inline.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Cannot add field",
9 | "trace": [
10 | "Query",
11 | "@addField"
12 | ],
13 | "description": "Path: [post, user, name] contains resolver expr at [Post.user]"
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-grpc-missing-fields.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "missing key: id",
9 | "trace": [
10 | "Query",
11 | "news",
12 | "@grpc",
13 | "NewsData",
14 | "news"
15 | ],
16 | "description": null
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-hostname-faliure.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Parsing failed because of invalid IP address syntax",
9 | "trace": [
10 | "schema",
11 | "@server",
12 | "hostname"
13 | ],
14 | "description": null
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-http-headers.md_merged.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatter
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream @link(src: "schema_0.graphql", type: Config) {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | foo: String @http(url: "http://localhost:4000/foo", headers: [{key: "foo", value: "bar"}])
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-inline-error.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Cannot add field",
9 | "trace": [
10 | "Query",
11 | "@addField",
12 | "street"
13 | ],
14 | "description": "Path [user, address, street] does not exist"
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-upstream.md_merged.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatter
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream(proxy: {url: "http://localhost:8085"}) @link(src: "schema_0.graphql", type: Config) {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | hello: String @http(url: "http://localhost:8000/hello")
12 | }
13 |
--------------------------------------------------------------------------------
/tests/execution/test-upstream.md:
--------------------------------------------------------------------------------
1 | ---
2 | identity: true
3 | ---
4 |
5 | # test-upstream
6 |
7 | ```yaml @config
8 | upstream:
9 | proxy:
10 | url: "http://localhost:8085"
11 | ```
12 |
13 | ```graphql @schema
14 | schema @server @upstream {
15 | query: Query
16 | }
17 |
18 | type Query {
19 | hello: String @http(url: "http://localhost:8000/hello")
20 | }
21 | ```
22 |
--------------------------------------------------------------------------------
/src/core/generator/tests/snapshots/json_to_config_spec__list_incompatible_object.json.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/generator/tests/json_to_config_spec.rs
3 | expression: cfg.to_sdl()
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | inCompatibleObjects: [JSON] @http(url: "https://example.com/api/v2/users")
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/call-mutation.md_3.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "insertPostToFirstUser": {
14 | "body": "post-body"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-http-003.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: ID!): User!
8 | }
9 |
10 | type User {
11 | id: ID!
12 | name: String!
13 | profilePic(size: Int, width: Int, height: Int): String!
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-http-004.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | user(id: ID!): User!
8 | }
9 |
10 | type User {
11 | id: ID!
12 | name: String!
13 | profilePic(size: Int, width: Int, height: Int): String!
14 | }
15 |
16 | schema {
17 | query: Query
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-datasource-with-args.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "name": "Leanne Graham"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/omit-resolved-by-parent.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "address": "Kulas Light"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-expr-with-add-field.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Cannot add field",
9 | "trace": [
10 | "Query",
11 | "@addField"
12 | ],
13 | "description": "Path: [post, user, name] contains resolver expr at [Post.user]"
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-http-baseurl.md_merged.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatter
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream @link(src: "schema_0.graphql", type: Config) {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | bar: String @http(url: "http://abc.com/bar")
12 | foo: String @http(url: "http://foo.com/foo")
13 | }
14 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-http-tmpl.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Post {
7 | id: Int
8 | user: User
9 | userId: Int!
10 | }
11 |
12 | type Query {
13 | posts: [Post]
14 | }
15 |
16 | type User {
17 | id: Int
18 | name: String
19 | }
20 |
21 | schema {
22 | query: Query
23 | }
24 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-http-with-add-field.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Cannot add field",
9 | "trace": [
10 | "Query",
11 | "@addField"
12 | ],
13 | "description": "Path: [post, user, name] contains resolver http at [Post.user]"
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/tests/execution/test-cache.md:
--------------------------------------------------------------------------------
1 | ---
2 | identity: true
3 | ---
4 |
5 | # test-cache
6 |
7 | ```graphql @schema
8 | schema @server @upstream {
9 | query: Query
10 | }
11 |
12 | type Query {
13 | user: User @http(url: "http://jsonplaceholder.typicode.com/foo") @cache(maxAge: 300)
14 | }
15 |
16 | type User @cache(maxAge: 900) {
17 | id: Int
18 | name: String
19 | }
20 | ```
21 |
--------------------------------------------------------------------------------
/src/core/config/transformer/fixtures/recursive-input.graphql:
--------------------------------------------------------------------------------
1 | schema @server(port: 8000) {
2 | query: Query
3 | }
4 |
5 | type Bar {
6 | name: Foo
7 | rec: Bar
8 | }
9 |
10 | type Foo {
11 | name: String
12 | }
13 |
14 | type Query {
15 | bars(filter: Bar): String
16 | @graphQL(url: "http://localhost", args: [{key: "baz", value: "{{.args.baz}}"}], name: "bars")
17 | }
18 |
--------------------------------------------------------------------------------
/src/core/generator/tests/snapshots/json_to_config_spec__boolean.json.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/generator/tests/json_to_config_spec.rs
3 | expression: cfg.to_sdl()
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | userStatus(GEN__1: Int!): Boolean @http(url: "https://example.com/user/{{.args.GEN__1}}/online")
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/custom-headers.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json",
10 | "x-id": "1",
11 | "x-name": "John Doe"
12 | },
13 | "body": {
14 | "data": {
15 | "greet": "Hello World!"
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-datasource-mutation.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "createUser": {
14 | "name": "Test Name"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-alias-on-enum.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type DTA {
7 | departments: [Department]
8 | }
9 |
10 | enum Department {
11 | ENGINEERING
12 | HUMAN_RESOURCE
13 | MARKETING
14 | }
15 |
16 | type Query {
17 | color: DTA
18 | }
19 |
20 | schema {
21 | query: Query
22 | }
23 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-graphql-with-add-field.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Cannot add field",
9 | "trace": [
10 | "Query",
11 | "@addField"
12 | ],
13 | "description": "Path: [post, user, name] contains resolver graphQL at [Post.user]"
14 | }
15 | ]
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-groupby-without-batching.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Batching capability was used without enabling it in upstream",
9 | "trace": [
10 | "Query",
11 | "user",
12 | "@http"
13 | ],
14 | "description": null
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-server-vars.md_merged.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatter
4 | snapshot_kind: text
5 | ---
6 | schema @server(vars: [{key: "foo", value: "bar"}]) @upstream @link(src: "schema_0.graphql", type: Config) {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | foo: String @http(url: "http://jsonplaceholder.typicode.com/foo")
12 | }
13 |
--------------------------------------------------------------------------------
/src/core/config/config_module/fixtures/router.graphql:
--------------------------------------------------------------------------------
1 | schema @server(port: 8000) @upstream(httpCache: 42, batch: {delay: 100}) {
2 | # @link(src: "http://localhost:4000", type: SubGraph, meta: {name: "Users"})
3 | # @link(src: "http://localhost:5000", type: SubGraph, meta: {name: "Posts"})
4 | query: Query
5 | }
6 |
7 | type Query {
8 | version: String @expr(body: "test")
9 | }
10 |
--------------------------------------------------------------------------------
/src/core/config/npo/fixtures/multiple-keys.graphql:
--------------------------------------------------------------------------------
1 | schema @server @upstream {
2 | query: Query
3 | }
4 |
5 | type F1 {
6 | f2: F2 @http(url: "")
7 | f3: F3 @http(url: "")
8 | }
9 |
10 | type F2 {
11 | str: String
12 | }
13 | type F3 {
14 | str: String
15 | }
16 |
17 | type Query {
18 | f1: [F1] @http(url: "")
19 | f2: F2 @http(url: "")
20 | f3: F3 @http(url: "")
21 | }
22 |
--------------------------------------------------------------------------------
/src/core/generator/json/snapshots/tailcall__core__generator__json__operation_generator__test__query.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/generator/json/operation_generator.rs
3 | expression: config.to_sdl()
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | postComments(postId: Int): T44 @http(url: "https://jsonplaceholder.typicode.com/comments", query: [{key: "postId", value: "{{.args.postId}}"}])
8 | }
9 |
--------------------------------------------------------------------------------
/tests/core/snapshots/add-field.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Address {
7 | geo: Geo
8 | }
9 |
10 | type Geo {
11 | lat: String
12 | }
13 |
14 | type Query {
15 | user: User
16 | }
17 |
18 | type User {
19 | address: Address
20 | lat: String
21 | }
22 |
23 | schema {
24 | query: Query
25 | }
26 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-014.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "id": 1,
15 | "name": "Admin"
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/nullable-arg-query.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "users": [
14 | {
15 | "id": 1
16 | }
17 | ]
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/tests/core/snapshots/related-fields-recursive.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type NodeA {
7 | name: String
8 | nodeB: NodeB
9 | }
10 |
11 | type NodeB {
12 | name: String
13 | nodeA: NodeA
14 | }
15 |
16 | type Query {
17 | queryNodeA: [NodeA]
18 | }
19 |
20 | schema {
21 | query: Query
22 | }
23 |
--------------------------------------------------------------------------------
/tests/core/snapshots/showcase.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": null,
13 | "errors": [
14 | {
15 | "message": "No Config URL specified"
16 | }
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-eval-partial.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Post {
7 | foo: String
8 | id: Int!
9 | user: User
10 | userId: Int!
11 | }
12 |
13 | type Query {
14 | post(id: Int!): [Post]
15 | }
16 |
17 | type User {
18 | id: Int!
19 | }
20 |
21 | schema {
22 | query: Query
23 | }
24 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-graphqlsource.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Post {
7 | id: Int!
8 | user: User
9 | userId: Int!
10 | }
11 |
12 | type Query {
13 | post(id: Int!): Post
14 | }
15 |
16 | type User {
17 | id: Int
18 | name: String
19 | }
20 |
21 | schema {
22 | query: Query
23 | }
24 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-http-with-mustache-expr.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type A {
7 | a: Int
8 | bc: BC
9 | }
10 |
11 | type BC {
12 | d: D
13 | f: Boolean
14 | }
15 |
16 | type D {
17 | e: Int
18 | }
19 |
20 | type Query {
21 | a: A
22 | }
23 |
24 | schema {
25 | query: Query
26 | }
27 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-input-out.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "queryTest": [
14 | {
15 | "id": 1
16 | }
17 | ]
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-multiple-config-types.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "bar": {
14 | "name": "name",
15 | "id": 1
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-multiple-config-types.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | input Input {
7 | id: Int
8 | name: String
9 | }
10 |
11 | type Output {
12 | id: Int
13 | name: String
14 | }
15 |
16 | type Query {
17 | bar(input: Input): Output
18 | }
19 |
20 | schema {
21 | query: Query
22 | }
23 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-on-response-body.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "hello": {
14 | "name": "Leanne Graham - Changed by JS"
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-params-as-body.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "firstUser": {
14 | "id": 1,
15 | "name": "foo"
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-scalars.md_4.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "any1": {
14 | "test": "abc"
15 | },
16 | "any2": "string-value"
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/execution_spec.rs:
--------------------------------------------------------------------------------
1 | mod core;
2 |
3 | use core::spec::load_and_test_execution_spec;
4 | use std::path::Path;
5 |
6 | fn run_execution_spec(path: &Path) -> datatest_stable::Result<()> {
7 | let result = tokio_test::block_on(load_and_test_execution_spec(path));
8 |
9 | Ok(result?)
10 | }
11 |
12 | datatest_stable::harness!(run_execution_spec, "tests/execution", r"^.*\.md$");
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/enum-args.md_merged.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatter
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream @link(src: "schema_0.graphql", type: Config) {
7 | query: Query
8 | }
9 |
10 | enum COLOR {
11 | BLUE
12 | GREEN
13 | RED
14 | }
15 |
16 | type Query {
17 | color(item: COLOR): COLOR @expr(body: "{{.args.item}}")
18 | }
19 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-http-014.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "id": 1,
15 | "name": "Admin"
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/showcase.md_2.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": null,
13 | "errors": [
14 | {
15 | "message": "Invalid Config URL specified"
16 | }
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-enum-aliases.md_merged.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatter
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream @link(src: "schema_0.graphql", type: Config) {
7 | query: Query
8 | }
9 |
10 | enum Foo {
11 | BAR @alias(options: ["OP1", "OP2"])
12 | BAZ
13 | }
14 |
15 | type Query {
16 | foo: Foo @expr(body: "OP1")
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-js-multi-onRequest-handlers.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "foo": "its intercepted foo",
14 | "bar": "its intercepted bar"
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-js-request-response-2.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "hello": "darkness",
14 | "hi": "I've come to talk with you again"
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-query-documentation.md_merged.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatter
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream @link(src: "schema_0.graphql", type: Config) {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | """
12 | This is test
13 | """
14 | foo: String @http(url: "http://jsonplaceholder.typicode.com/foo")
15 | }
16 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-required-fields.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "basicPresent": {
14 | "id": 1,
15 | "bar": "bar_1"
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-required-fields.md_3.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "relaxedPresent": {
14 | "id": 1,
15 | "bar": "bar_1"
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-response-headers-name.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Parsing failed because of invalid HTTP header name",
9 | "trace": [
10 | "schema",
11 | "@server",
12 | "headers",
13 | "custom"
14 | ],
15 | "description": null
16 | }
17 | ]
18 |
--------------------------------------------------------------------------------
/tests/core/snapshots/with-args.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": [
14 | {
15 | "name": "Leanne Graham"
16 | }
17 | ]
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/tests/execution/default-value-config.md:
--------------------------------------------------------------------------------
1 | # default value for input Type
2 |
3 | ```graphql @schema
4 | schema {
5 | query: Query
6 | }
7 |
8 | type Query {
9 | foo(input: Input!): Int @http(url: "http://abc.com/foo/{{.args.input.id}}")
10 | bar(input: Input = {id: 3}): Int @http(url: "http://abc.com/foo/{{.args.input.id}}")
11 | }
12 |
13 | input Input {
14 | id: Int = 1
15 | }
16 | ```
17 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | # flyctl launch added from .gitignore
2 | target
3 | .idea
4 | **/*.json
5 | **/*.svg
6 |
7 | # flyctl launch added from .idea/.gitignore
8 | # Default ignored files
9 | .idea/shelf
10 | .idea/workspace.xml
11 | # Editor-based HTTP Client requests
12 | .idea/httpRequests
13 | # Datasource local storage ignored files
14 | .idea/dataSources
15 | .idea/dataSources.local.xml
16 | fly.toml
17 |
--------------------------------------------------------------------------------
/src/core/generator/tests/snapshots/json_to_config_spec__null.json.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: src/core/generator/tests/json_to_config_spec.rs
3 | expression: cfg.to_sdl()
4 | snapshot_kind: text
5 | ---
6 | schema @server @upstream {
7 | query: Query
8 | }
9 |
10 | type Query {
11 | usersAge(age: Int): JSON @http(url: "https://example.com/users", query: [{key: "age", value: "{{.args.age}}"}])
12 | }
13 |
--------------------------------------------------------------------------------
/tests/core/snapshots/content-type-graphql.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "city": "Globe",
15 | "name": "Tailcall"
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-001.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "user": {
14 | "city": "Globe",
15 | "name": "Tailcall"
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-010.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "nearby": {
14 | "id": 12,
15 | "name": "Location 12"
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-010.md_1.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "nearby": {
14 | "id": 12,
15 | "name": "Location 12"
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/graphql-conformance-nested-lists.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | addUsers(userNames: [[String!]!]!): Boolean
8 | userGroups: [[User!]!]!
9 | }
10 |
11 | type User {
12 | accountRef: String!
13 | id: ID!
14 | name: String!
15 | }
16 |
17 | schema {
18 | query: Query
19 | }
20 |
--------------------------------------------------------------------------------
/tests/core/snapshots/ref-other-nested.md_client.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: formatted
4 | snapshot_kind: text
5 | ---
6 | type Query {
7 | firstUser: User1
8 | }
9 |
10 | type User {
11 | id: Int
12 | name: String
13 | }
14 |
15 | type User1 {
16 | user1: User2
17 | }
18 |
19 | type User2 {
20 | user2: User
21 | }
22 |
23 | schema {
24 | query: Query
25 | }
26 |
--------------------------------------------------------------------------------
/tests/core/snapshots/test-response-header-value.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "Parsing failed because of failed to parse header value",
9 | "trace": [
10 | "schema",
11 | "@server",
12 | "headers",
13 | "custom"
14 | ],
15 | "description": null
16 | }
17 | ]
18 |
--------------------------------------------------------------------------------
/tests/execution/experimental-headers-error.md:
--------------------------------------------------------------------------------
1 | ---
2 | error: true
3 | ---
4 |
5 | # test-experimental-headers-error
6 |
7 | ```yaml @config
8 | server:
9 | headers:
10 | experimental: ["non-experimental", "foo", "bar", "tailcall"]
11 | ```
12 |
13 | ```graphql @schema
14 | schema {
15 | query: Query
16 | }
17 |
18 | type Query {
19 | hello: String @expr(body: "World!")
20 | }
21 | ```
22 |
--------------------------------------------------------------------------------
/tests/execution/test-server-vars.md:
--------------------------------------------------------------------------------
1 | ---
2 | identity: true
3 | ---
4 |
5 | # test-server-vars
6 |
7 | ```yaml @config
8 | server:
9 | vars:
10 | - key: "foo"
11 | value: "bar"
12 | ```
13 |
14 | ```graphql @schema
15 | schema @server @upstream {
16 | query: Query
17 | }
18 |
19 | type Query {
20 | foo: String @http(url: "http://jsonplaceholder.typicode.com/foo")
21 | }
22 | ```
23 |
--------------------------------------------------------------------------------
/examples/apollo-tracing.graphql:
--------------------------------------------------------------------------------
1 | schema @server(port: 8000, hostname: "0.0.0.0") @telemetry(export: {apollo: {apiKey: "1234", graphRef: "abc@123"}}) {
2 | query: Query
3 | }
4 |
5 | type Query @cache(maxAge: 30000) {
6 | posts: [Post] @http(url: "http://jsonplaceholder.typicode.com/posts")
7 | }
8 |
9 | type Post {
10 | id: Int!
11 | userId: Int!
12 | title: String!
13 | body: String!
14 | }
15 |
--------------------------------------------------------------------------------
/npm/pre-install.js:
--------------------------------------------------------------------------------
1 | const os = process.platform
2 | const arch = process.arch
3 |
4 | const dependency = Object.keys(optionalDependencies).find((name) => name.includes(`${os}-${arch}`))
5 | if (!dependency) {
6 | const redColor = "\x1b[31m"
7 | const resetColor = "\x1b[0m"
8 | console.error(`${redColor} Tailcall does not support platform ${os} arch ${arch} ${resetColor}`)
9 | process.exit(1)
10 | }
11 |
--------------------------------------------------------------------------------
/tailcall-fixtures/fixtures/configs/proto_no_pkg.graphql:
--------------------------------------------------------------------------------
1 | schema @server(port: 8000) @link(id: "news", src: "proto/news_no_pkg.proto", type: Protobuf) {
2 | query: Query
3 | }
4 |
5 | type Query {
6 | news: News! @grpc(url: "http://localhost:50051", method: "news.NewsService.GetAllNews")
7 | }
8 |
9 | type News {
10 | id: Int
11 | title: String
12 | body: String
13 | postImage: String
14 | }
15 |
--------------------------------------------------------------------------------
/tests/core/snapshots/auth-protected-without-auth.md_error.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: errors
4 | snapshot_kind: text
5 | ---
6 | [
7 | {
8 | "message": "@protected operator is used but there is no @link definitions for auth providers",
9 | "trace": [
10 | "Query",
11 | "data",
12 | "@protected"
13 | ],
14 | "description": null
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/tests/core/snapshots/batching-disabled.md_0.snap:
--------------------------------------------------------------------------------
1 | ---
2 | source: tests/core/spec.rs
3 | expression: response
4 | snapshot_kind: text
5 | ---
6 | {
7 | "status": 200,
8 | "headers": {
9 | "content-type": "application/json"
10 | },
11 | "body": {
12 | "data": {
13 | "u1": {
14 | "id": 1
15 | },
16 | "u2": {
17 | "id": 2
18 | }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------