From 345785dd30ed3b2bc661306b5f18622c5cd26849 Mon Sep 17 00:00:00 2001 From: Kiryl Mialeshka <8974488+meskill@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:15:43 +0200 Subject: [PATCH] feat(grpc): additional scalar types (#2002) Co-authored-by: Adam McCullough Co-authored-by: Tushar Mathur Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Mehul Mathur Co-authored-by: Amit Singh --- generated/.tailcallrc.graphql | 44 ++++++ generated/.tailcallrc.schema.json | 82 ++++++++++- src/core/generator/from_proto.rs | 19 ++- ...__generator__from_proto__test__movies.snap | 8 +- ...rator__from_proto__test__scalar_types.snap | 51 +++++++ src/core/grpc/protobuf.rs | 105 ++++++++++++++- src/core/scalar/bytes.rs | 46 +++++++ src/core/scalar/date.rs | 4 +- src/core/scalar/email.rs | 20 ++- src/core/scalar/empty.rs | 4 +- src/core/scalar/int128.rs | 49 +++++++ src/core/scalar/int16.rs | 54 ++++++++ src/core/scalar/int32.rs | 54 ++++++++ src/core/scalar/int64.rs | 49 +++++++ src/core/scalar/int8.rs | 54 ++++++++ src/core/scalar/json.rs | 8 +- src/core/scalar/mod.rs | 67 ++++++++- src/core/scalar/phone.rs | 4 +- src/core/scalar/uint128.rs | 49 +++++++ src/core/scalar/uint16.rs | 51 +++++++ src/core/scalar/uint32.rs | 51 +++++++ src/core/scalar/uint64.rs | 49 +++++++ src/core/scalar/uint8.rs | 51 +++++++ src/core/scalar/url.rs | 4 +- .../fixtures/protobuf/scalars.proto | 30 +++++ tailcall-typedefs/src/gen_gql_schema.rs | 9 +- tailcall-typedefs/src/main.rs | 2 +- .../add-field-index-list.md_client.snap | 24 +++- .../add-field-many-list.md_client.snap | 24 +++- .../snapshots/add-field-many.md_client.snap | 24 +++- .../snapshots/add-field-modify.md_client.snap | 24 +++- .../add-field-with-composition.md_client.snap | 24 +++- .../add-field-with-modify.md_client.snap | 24 +++- tests/core/snapshots/add-field.md_client.snap | 24 +++- .../snapshots/apollo-tracing.md_client.snap | 24 +++- .../async-cache-disabled.md_client.snap | 24 +++- ...e-enable-multiple-resolvers.md_client.snap | 24 +++- .../async-cache-enabled.md_client.snap | 24 +++- .../core/snapshots/auth-basic.md_client.snap | 24 +++- tests/core/snapshots/auth-jwt.md_client.snap | 24 +++- tests/core/snapshots/auth.md_client.snap | 24 +++- .../snapshots/batching-default.md_client.snap | 24 +++- .../batching-disabled.md_client.snap | 24 +++- .../batching-group-by-default.md_client.snap | 24 +++- .../batching-group-by.md_client.snap | 24 +++- .../snapshots/batching-post.md_client.snap | 24 +++- tests/core/snapshots/batching.md_client.snap | 24 +++- .../snapshots/cache-control.md_client.snap | 24 +++- .../caching-collision.md_client.snap | 24 +++- tests/core/snapshots/caching.md_client.snap | 24 +++- .../call-graphql-datasource.md_client.snap | 24 +++- .../call-multiple-steps-piping.md_client.snap | 24 +++- .../snapshots/call-mutation.md_client.snap | 24 +++- .../snapshots/call-operator.md_client.snap | 24 +++- .../cors-allow-cred-false.md_client.snap | 24 +++- .../cors-allow-cred-true.md_client.snap | 24 +++- .../cors-allow-cred-vary.md_client.snap | 24 +++- .../snapshots/custom-headers.md_client.snap | 24 +++- tests/core/snapshots/env-value.md_client.snap | 24 +++- .../experimental-headers.md_client.snap | 24 +++- ...ql-dataloader-batch-request.md_client.snap | 24 +++- ...dataloader-no-batch-request.md_client.snap | 24 +++- .../graphql-datasource-errors.md_client.snap | 24 +++- ...graphql-datasource-mutation.md_client.snap | 24 +++- .../graphql-datasource-no-args.md_client.snap | 24 +++- ...raphql-datasource-with-args.md_client.snap | 24 +++- .../core/snapshots/grpc-batch.md_client.snap | 24 +++- .../core/snapshots/grpc-error.md_client.snap | 24 +++- tests/core/snapshots/grpc-map.md_client.snap | 24 +++- ...-override-url-from-upstream.md_client.snap | 24 +++- ...rpc-proto-with-same-package.md_client.snap | 24 +++- .../snapshots/grpc-reflection.md_client.snap | 24 +++- .../core/snapshots/grpc-simple.md_client.snap | 24 +++- .../grpc-url-from-upstream.md_client.snap | 24 +++- tests/core/snapshots/https.md_client.snap | 24 +++- .../snapshots/inline-field.md_client.snap | 24 +++- .../inline-index-list.md_client.snap | 24 +++- .../snapshots/inline-many-list.md_client.snap | 24 +++- .../core/snapshots/inline-many.md_client.snap | 24 +++- tests/core/snapshots/io-cache.md_client.snap | 24 +++- .../snapshots/js-directive.md_client.snap | 22 +++ .../jsonplaceholder-call-post.md_client.snap | 24 +++- .../snapshots/modified-field.md_client.snap | 24 +++- .../snapshots/mutation-put.md_client.snap | 24 +++- tests/core/snapshots/mutation.md_client.snap | 24 +++- .../snapshots/n-plus-one-list.md_client.snap | 24 +++- .../core/snapshots/n-plus-one.md_client.snap | 24 +++- .../snapshots/nested-objects.md_client.snap | 24 +++- .../snapshots/nesting-level3.md_client.snap | 24 +++- .../nullable-arg-query.md_client.snap | 24 +++- .../snapshots/omit-index-list.md_client.snap | 24 +++- tests/core/snapshots/omit-many.md_client.snap | 24 +++- .../omit-resolved-by-parent.md_client.snap | 24 +++- .../recursive-type-json.md_client.snap | 24 +++- .../snapshots/recursive-types.md_client.snap | 24 +++- .../snapshots/ref-other-nested.md_client.snap | 24 +++- tests/core/snapshots/ref-other.md_client.snap | 24 +++- .../snapshots/rename-field.md_client.snap | 24 +++- ...equest-to-upstream-batching.md_client.snap | 24 +++- .../resolve-with-headers.md_client.snap | 24 +++- .../resolve-with-vars.md_client.snap | 24 +++- .../resolved-by-parent.md_client.snap | 24 +++- .../snapshots/rest-api-error.md_client.snap | 24 +++- .../snapshots/rest-api-post.md_client.snap | 24 +++- tests/core/snapshots/rest-api.md_client.snap | 24 +++- tests/core/snapshots/showcase.md_client.snap | 24 +++- .../snapshots/simple-graphql.md_client.snap | 24 +++- .../snapshots/simple-query.md_client.snap | 24 +++- .../test-add-field-list.md_client.snap | 24 +++- .../snapshots/test-add-field.md_client.snap | 24 +++- ...st-add-link-to-empty-config.md_client.snap | 24 +++- .../test-batching-group-by.md_client.snap | 24 +++- .../core/snapshots/test-cache.md_client.snap | 24 +++- .../test-custom-scalar.md_client.snap | 24 +++- .../test-custom-types.md_client.snap | 24 +++- .../test-description-many.md_client.snap | 24 +++- .../test-enum-default.md_client.snap | 24 +++- .../test-enum-description.md_client.snap | 25 +++- tests/core/snapshots/test-enum.md_client.snap | 24 +++- .../test-expr-scalar-as-string.md_client.snap | 22 +++ .../test-expr-with-mustache.md_client.snap | 24 +++- tests/core/snapshots/test-expr.md_client.snap | 24 +++- .../test-graphqlsource.md_client.snap | 24 +++- tests/core/snapshots/test-grpc.md_client.snap | 24 +++- .../test-http-baseurl.md_client.snap | 24 +++- .../test-http-headers.md_client.snap | 24 +++- .../snapshots/test-http-tmpl.md_client.snap | 24 +++- ...est-http-with-mustache-expr.md_client.snap | 24 +++- tests/core/snapshots/test-http.md_client.snap | 24 +++- .../snapshots/test-inline-list.md_client.snap | 24 +++- .../core/snapshots/test-inline.md_client.snap | 24 +++- .../test-input-documentation.md_client.snap | 23 +++- .../test-interface-from-json.md_client.snap | 24 +++- .../test-interface-result.md_client.snap | 24 +++- .../snapshots/test-interface.md_client.snap | 24 +++- .../test-js-request-response-2.md_client.snap | 24 +++- .../test-js-request-response.md_client.snap | 24 +++- ...erge-right-with-link-config.md_client.snap | 24 +++- .../test-merge-server-sdl.md_client.snap | 24 +++- .../core/snapshots/test-modify.md_client.snap | 24 +++- .../test-multi-interface.md_client.snap | 24 +++- .../test-nested-input.md_client.snap | 24 +++- .../snapshots/test-nested-link.md_client.snap | 24 +++- .../test-nested-value.md_client.snap | 24 +++- .../test-null-in-array.md_client.snap | 24 +++- .../test-null-in-object.md_client.snap | 24 +++- .../snapshots/test-omit-list.md_client.snap | 24 +++- tests/core/snapshots/test-omit.md_client.snap | 24 +++- .../test-params-as-body.md_client.snap | 24 +++- .../test-query-documentation.md_client.snap | 24 +++- .../core/snapshots/test-query.md_client.snap | 24 +++- .../snapshots/test-ref-other.md_client.snap | 24 +++- .../test-scalars-builtin.md_client.snap | 22 +++ .../snapshots/test-scalars-integers.md_0.snap | 16 +++ .../snapshots/test-scalars-integers.md_1.snap | 16 +++ .../test-scalars-integers.md_10.snap | 27 ++++ .../test-scalars-integers.md_11.snap | 27 ++++ .../test-scalars-integers.md_12.snap | 27 ++++ .../test-scalars-integers.md_13.snap | 27 ++++ .../test-scalars-integers.md_14.snap | 27 ++++ .../test-scalars-integers.md_15.snap | 27 ++++ .../test-scalars-integers.md_16.snap | 27 ++++ .../test-scalars-integers.md_17.snap | 27 ++++ .../test-scalars-integers.md_18.snap | 27 ++++ .../test-scalars-integers.md_19.snap | 27 ++++ .../snapshots/test-scalars-integers.md_2.snap | 16 +++ .../snapshots/test-scalars-integers.md_3.snap | 27 ++++ .../snapshots/test-scalars-integers.md_4.snap | 27 ++++ .../snapshots/test-scalars-integers.md_5.snap | 16 +++ .../snapshots/test-scalars-integers.md_6.snap | 16 +++ .../snapshots/test-scalars-integers.md_7.snap | 16 +++ .../snapshots/test-scalars-integers.md_8.snap | 27 ++++ .../snapshots/test-scalars-integers.md_9.snap | 27 ++++ .../test-scalars-integers.md_client.snap | 54 ++++++++ .../test-scalars-integers.md_merged.snap | 20 +++ .../test-scalars-validation.md_client.snap | 22 +++ tests/core/snapshots/test-scalars.md_10.snap | 27 ++++ tests/core/snapshots/test-scalars.md_11.snap | 27 ++++ tests/core/snapshots/test-scalars.md_5.snap | 18 +-- tests/core/snapshots/test-scalars.md_6.snap | 4 +- tests/core/snapshots/test-scalars.md_8.snap | 4 +- tests/core/snapshots/test-scalars.md_9.snap | 4 +- .../snapshots/test-scalars.md_client.snap | 25 +++- .../snapshots/test-scalars.md_merged.snap | 3 +- .../snapshots/test-server-vars.md_client.snap | 24 +++- .../test-set-cookie-headers.md_client.snap | 24 +++- .../test-static-value.md_client.snap | 24 +++- tests/core/snapshots/test-tag.md_client.snap | 24 +++- .../core/snapshots/test-union.md_client.snap | 24 +++- .../test-upstream-headers.md_client.snap | 24 +++- .../snapshots/test-upstream.md_client.snap | 24 +++- .../upstream-batching.md_client.snap | 24 +++- .../upstream-fail-request.md_client.snap | 24 +++- .../snapshots/with-args-url.md_client.snap | 24 +++- tests/core/snapshots/with-args.md_client.snap | 24 +++- .../snapshots/with-nesting.md_client.snap | 24 +++- tests/execution/test-scalars-integers.md | 127 ++++++++++++++++++ tests/execution/test-scalars.md | 15 ++- 198 files changed, 4941 insertions(+), 207 deletions(-) create mode 100644 src/core/generator/snapshots/tailcall__core__generator__from_proto__test__scalar_types.snap create mode 100644 src/core/scalar/bytes.rs create mode 100644 src/core/scalar/int128.rs create mode 100644 src/core/scalar/int16.rs create mode 100644 src/core/scalar/int32.rs create mode 100644 src/core/scalar/int64.rs create mode 100644 src/core/scalar/int8.rs create mode 100644 src/core/scalar/uint128.rs create mode 100644 src/core/scalar/uint16.rs create mode 100644 src/core/scalar/uint32.rs create mode 100644 src/core/scalar/uint64.rs create mode 100644 src/core/scalar/uint8.rs create mode 100644 tailcall-fixtures/fixtures/protobuf/scalars.proto create mode 100644 tests/core/snapshots/test-scalars-integers.md_0.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_1.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_10.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_11.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_12.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_13.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_14.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_15.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_16.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_17.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_18.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_19.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_2.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_3.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_4.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_5.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_6.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_7.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_8.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_9.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_client.snap create mode 100644 tests/core/snapshots/test-scalars-integers.md_merged.snap create mode 100644 tests/core/snapshots/test-scalars.md_10.snap create mode 100644 tests/core/snapshots/test-scalars.md_11.snap create mode 100644 tests/execution/test-scalars-integers.md diff --git a/generated/.tailcallrc.graphql b/generated/.tailcallrc.graphql index dabbc52ff1..44ab0a5a90 100644 --- a/generated/.tailcallrc.graphql +++ b/generated/.tailcallrc.graphql @@ -794,6 +794,10 @@ input Schema { Enum: [String!] } """ +Represents list of bytes +""" +scalar Bytes +""" A date string, such as 2007-12-03, is compliant with the full-date format outlined in section 5.6 of the RFC 3339 (https://datatracker.ietf.org/doc/html/rfc3339) profile of the ISO 8601 standard for the representation of dates and times using the Gregorian calendar. """ scalar Date @@ -806,6 +810,26 @@ Empty scalar type represents an empty value. """ scalar Empty """ +Represents signed integer type 128 bit size as string +""" +scalar Int128 +""" +Represents signed integer type 16bit size +""" +scalar Int16 +""" +Represents signed integer type 32bit size +""" +scalar Int32 +""" +Represents signed integer type 64bit size as string +""" +scalar Int64 +""" +Represents signed integer type 8bit size +""" +scalar Int8 +""" The JSON scalar type represents JSON values as specified by [ECMA-404](www.ecma-international.org/publications/files/ECMA-ST/ ECMA-404.pdf). """ scalar JSON @@ -814,6 +838,26 @@ A field whose value conforms to the standard E.164 format as specified in E.164 """ scalar PhoneNumber """ +Represents unsigned integer type 128bit size as string +""" +scalar UInt128 +""" +Represents unsigned integer type 16bit size +""" +scalar UInt16 +""" +Represents unsigned integer type 32bit size +""" +scalar UInt32 +""" +Represents unsigned integer type 64bit size as string +""" +scalar UInt64 +""" +Represents unsigned integer type 8bit size +""" +scalar UInt8 +""" A field whose value conforms to the standard URL format as specified in RFC3986 (https://www.ietf.org/rfc/rfc3986.txt), and it uses real JavaScript URL objects. """ scalar Url diff --git a/generated/.tailcallrc.schema.json b/generated/.tailcallrc.schema.json index a53f3864d8..2757a90846 100644 --- a/generated/.tailcallrc.schema.json +++ b/generated/.tailcallrc.schema.json @@ -192,6 +192,11 @@ } } }, + "Bytes": { + "title": "Bytes", + "description": "Represents list of bytes", + "type": "string" + }, "Cache": { "description": "The @cache operator enables caching for the query, field or type it is applied to.", "type": "object", @@ -295,26 +300,26 @@ }, "Date": { "title": "Date", + "description": "A date string, such as 2007-12-03, is compliant with the full-date format outlined in section 5.6 of the RFC 3339 (https://datatracker.ietf.org/doc/html/rfc3339) profile of the ISO 8601 standard for the representation of dates and times using the Gregorian calendar.", "type": "object", "required": [ "Date" ], "properties": { "Date": { - "description": "A date string, such as 2007-12-03, is compliant with the full-date format outlined in section 5.6 of the RFC 3339 (https://datatracker.ietf.org/doc/html/rfc3339) profile of the ISO 8601 standard for the representation of dates and times using the Gregorian calendar.", "type": "string" } } }, "Email": { "title": "Email", + "description": "field whose value conforms to the standard internet email address format as specified in HTML Spec: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address.", "type": "object", "required": [ "Email" ], "properties": { "Email": { - "description": "field whose value conforms to the standard internet email address format as specified in HTML Spec: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address.", "type": "string", "pattern": "/^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/" } @@ -322,13 +327,13 @@ }, "Empty": { "title": "Empty", + "description": "Empty scalar type represents an empty value.", "type": "object", "required": [ "Empty" ], "properties": { "Empty": { - "description": "Empty scalar type represents an empty value.", "type": "null" } } @@ -752,6 +757,36 @@ "HTTP2" ] }, + "Int128": { + "title": "Int128", + "description": "Represents signed integer type 128 bit size as string", + "type": "integer", + "format": "int128" + }, + "Int16": { + "title": "Int16", + "description": "Represents signed integer type 16bit size", + "type": "integer", + "format": "int16" + }, + "Int32": { + "title": "Int32", + "description": "Represents signed integer type 32bit size", + "type": "integer", + "format": "int32" + }, + "Int64": { + "title": "Int64", + "description": "Represents signed integer type 64bit size as string", + "type": "integer", + "format": "int64" + }, + "Int8": { + "title": "Int8", + "description": "Represents signed integer type 8bit size", + "type": "integer", + "format": "int8" + }, "JS": { "type": "object", "required": [ @@ -765,13 +800,13 @@ }, "JSON": { "title": "JSON", + "description": "The JSON scalar type represents JSON values as specified by [ECMA-404](www.ecma-international.org/publications/files/ECMA-ST/ ECMA-404.pdf).", "type": "object", "required": [ "JSON" ], "properties": { "JSON": { - "description": "The JSON scalar type represents JSON values as specified by [ECMA-404](www.ecma-international.org/publications/files/ECMA-ST/ ECMA-404.pdf).", "type": "string" } } @@ -888,13 +923,13 @@ }, "PhoneNumber": { "title": "PhoneNumber", + "description": "A field whose value conforms to the standard E.164 format as specified in E.164 specification (https://en.wikipedia.org/wiki/E.164).", "type": "object", "required": [ "PhoneNumber" ], "properties": { "PhoneNumber": { - "description": "A field whose value conforms to the standard E.164 format as specified in E.164 specification (https://en.wikipedia.org/wiki/E.164).", "type": "string" } } @@ -1295,6 +1330,41 @@ } } }, + "UInt128": { + "title": "UInt128", + "description": "Represents unsigned integer type 128bit size as string", + "type": "integer", + "format": "uint128", + "minimum": 0.0 + }, + "UInt16": { + "title": "UInt16", + "description": "Represents unsigned integer type 16bit size", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "UInt32": { + "title": "UInt32", + "description": "Represents unsigned integer type 32bit size", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "UInt64": { + "title": "UInt64", + "description": "Represents unsigned integer type 64bit size as string", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "UInt8": { + "title": "UInt8", + "description": "Represents unsigned integer type 8bit size", + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, "Union": { "type": "object", "required": [ @@ -1472,13 +1542,13 @@ }, "Url": { "title": "Url", + "description": "A field whose value conforms to the standard URL format as specified in RFC3986 (https://www.ietf.org/rfc/rfc3986.txt), and it uses real JavaScript URL objects.", "type": "object", "required": [ "Url" ], "properties": { "Url": { - "description": "A field whose value conforms to the standard URL format as specified in RFC3986 (https://www.ietf.org/rfc/rfc3986.txt), and it uses real JavaScript URL objects.", "type": "string" } } diff --git a/src/core/generator/from_proto.rs b/src/core/generator/from_proto.rs index 844529ad6f..1b5f9641ba 100644 --- a/src/core/generator/from_proto.rs +++ b/src/core/generator/from_proto.rs @@ -300,11 +300,18 @@ fn graphql_type_from_ref(name: &str) -> Result> { fn convert_primitive_type(proto_ty: &str) -> String { let binding = proto_ty.to_lowercase(); let proto_ty = binding.strip_prefix("type_").unwrap_or(proto_ty); + // use Int64Str and Uint64Str to represent 64bit integers as string by default + // it's how this values are represented in JSON by default in prost + // see tests in `protobuf::tests::scalars_proto_file` match proto_ty { "double" | "float" => "Float", - "int32" | "int64" | "fixed32" | "fixed64" | "uint32" | "uint64" => "Int", + "int32" | "sint32" | "fixed32" | "sfixed32" => "Int", + "int64" | "sint64" | "fixed64" | "sfixed64" => "Int64", + "uint32" => "UInt32", + "uint64" => "UInt64", "bool" => "Boolean", - "string" | "bytes" => "String", + "string" => "String", + "bytes" => "Bytes", x => x, } .to_string() @@ -487,4 +494,12 @@ mod test { insta::assert_snapshot!(config); Ok(()) } + + #[test] + fn test_scalar_types() -> Result<()> { + let set = compile_protobuf(&[protobuf::SCALARS])?; + let config = from_proto_resolved(&[set], "Query")?.to_sdl(); + insta::assert_snapshot!(config); + Ok(()) + } } diff --git a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__movies.snap b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__movies.snap index 8bc6d05eb1..0ab1c894ca 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__movies.snap +++ b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__movies.snap @@ -68,7 +68,7 @@ input google__protobuf__DurationInput @tag(id: "google.protobuf.Duration") { to +315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years """ - seconds: Int + seconds: Int64 } """ @@ -174,7 +174,7 @@ input google__protobuf__TimestampInput @tag(id: "google.protobuf.Timestamp") { 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. """ - seconds: Int + seconds: Int64 } """ @@ -325,7 +325,7 @@ type google__protobuf__Duration @tag(id: "google.protobuf.Duration") { to +315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years """ - seconds: Int + seconds: Int64 } """ @@ -420,7 +420,7 @@ type google__protobuf__Timestamp @tag(id: "google.protobuf.Timestamp") { 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. """ - seconds: Int + seconds: Int64 } """ diff --git a/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__scalar_types.snap b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__scalar_types.snap new file mode 100644 index 0000000000..109e98db36 --- /dev/null +++ b/src/core/generator/snapshots/tailcall__core__generator__from_proto__test__scalar_types.snap @@ -0,0 +1,51 @@ +--- +source: src/core/generator/from_proto.rs +expression: config +--- +schema @server @upstream { + query: Query +} + +input scalars__ItemInput @tag(id: "scalars.Item") { + boolean: Boolean + bytesType: Bytes + doubleNum: Float + fixedint32: Int + fixedint64: Int64 + floatNum: Float + integer32: Int + integer64: Int64 + sfixedint32: Int + sfixedint64: Int64 + sinteger32: Int + sinteger64: Int64 + str: String + uinteger32: UInt32 + uinteger64: UInt64 +} + +type Query { + scalars__Example__Get(item: scalars__ItemInput!): scalars__Result! @grpc(body: "{{.args.item}}", method: "scalars.Example.Get") +} + +type scalars__Item @tag(id: "scalars.Item") { + boolean: Boolean + bytesType: Bytes + doubleNum: Float + fixedint32: Int + fixedint64: Int64 + floatNum: Float + integer32: Int + integer64: Int64 + sfixedint32: Int + sfixedint64: Int64 + sinteger32: Int + sinteger64: Int64 + str: String + uinteger32: UInt32 + uinteger64: UInt64 +} + +type scalars__Result @tag(id: "scalars.Result") { + result: [scalars__Item] +} diff --git a/src/core/grpc/protobuf.rs b/src/core/grpc/protobuf.rs index 6edbbd8f73..3561cbcc5e 100644 --- a/src/core/grpc/protobuf.rs +++ b/src/core/grpc/protobuf.rs @@ -244,7 +244,6 @@ impl ProtobufOperation { pub mod tests { use std::path::Path; - // TODO: Rewrite protobuf tests use anyhow::Result; use prost_reflect::Value; use serde_json::json; @@ -491,4 +490,108 @@ pub mod tests { Ok(()) } + + #[tokio::test] + async fn scalars_proto_file() -> Result<()> { + let grpc_method = GrpcMethod::try_from("scalars.Example.Get").unwrap(); + + let file = ProtobufSet::from_proto_file(get_proto_file(protobuf::SCALARS).await?)?; + let service = file.find_service(&grpc_method)?; + let operation = service.find_operation(&grpc_method)?; + + // numbers as numbers in json + let input = operation + .convert_input(r#"{ "boolean": true, "doubleNum": 3.25, "fixedint64": 1248645648 }"#)?; + + assert_eq!( + input, + b"\0\0\0\0\x14\x08\x01\x19\0\0\0\0\0\0\n@)\x10\xd2lJ\0\0\0\0" + ); + + // the same output as input result from above to verify conversion + let output = b"\0\0\0\0\x16\n\x14\x08\x01\x19\0\0\0\0\0\0\n@)\x10\xd2lJ\0\0\0\0"; + + let parsed = operation.convert_output::(output)?; + + assert_eq!( + serde_json::to_value(parsed)?, + json!({ + "result": [{ + "boolean": true, + "bytesType": "", + "doubleNum": 3.25, + "fixedint32": 0, + // by default, prost outputs 64bit integers as strings + "fixedint64": "1248645648", + "floatNum": 0.0, + "integer32": 0, + "integer64": "0", + "sfixedint32": 0, + "sfixedint64": "0", + "sinteger32": 0, + "sinteger64": "0", + "str": "", + "uinteger32": 0, + "uinteger64": "0" + }] + }) + ); + + // numbers as string in json + let input = operation.convert_input( + r#"{ "integer32": "125", "sinteger64": "-18564864651", "uinteger64": "464646694646" }"#, + )?; + + assert_eq!( + input, + b"\0\0\0\0\x108}`\x95\xea\xea\xa8\x8a\x01x\xf6\xcd\xe7\xf8\xc2\r" + ); + + // the same output as input result from above to verify conversion + let output = b"\0\0\0\0\x12\n\x108}`\x95\xea\xea\xa8\x8a\x01x\xf6\xcd\xe7\xf8\xc2\r"; + + let parsed = operation.convert_output::(output)?; + + assert_eq!( + serde_json::to_value(parsed)?, + json!({ + "result": [{ + "boolean": false, + "bytesType": "", + "doubleNum": 0.0, + "fixedint32": 0, + "fixedint64": "0", + "floatNum": 0.0, + "integer32": 125, + "integer64": "0", + "sfixedint32": 0, + "sfixedint64": "0", + "sinteger32": 0, + "sinteger64": "-18564864651", + "str": "", + "uinteger32": 0, + "uinteger64": "464646694646" + }] + }) + ); + + // numbers out of range + let input: anyhow::Error = operation + .convert_input( + r#"{ + "floatNum": 1e154561.14848449464654948484542189, + "integer32": 32147483647, + "sinteger32": "32147483647", + "integer64": "4894654899848486451568418645165486465" + }"#, + ) + .unwrap_err(); + + assert_eq!( + input.to_string(), + "Failed to parse input according to type scalars.Item" + ); + + Ok(()) + } } diff --git a/src/core/scalar/bytes.rs b/src/core/scalar/bytes.rs new file mode 100644 index 0000000000..c241e8b9ca --- /dev/null +++ b/src/core/scalar/bytes.rs @@ -0,0 +1,46 @@ +use async_graphql_value::ConstValue; +use schemars::schema::Schema; +use schemars::{schema_for, JsonSchema}; + +use crate::core::json::JsonLike; + +/// Represents list of bytes +#[derive(JsonSchema, Default)] +pub struct Bytes(pub String); + +impl super::Scalar for Bytes { + fn validate(&self) -> fn(&ConstValue) -> bool { + |value| value.as_str_ok().is_ok() + } + + fn schema(&self) -> Schema { + schema_for!(Self).schema.into() + } +} + +#[cfg(test)] +mod test { + use async_graphql_value::ConstValue; + use serde_json::Number; + + use crate::core::scalar::{Bytes, Scalar}; + + #[test] + fn test_bytes_valid() { + assert!(Bytes::default().validate()(&ConstValue::String( + "\0\0".to_string() + ))); + } + + #[test] + fn test_bytes_invalid_null() { + assert!(!Bytes::default().validate()(&ConstValue::Null)); + } + + #[test] + fn test_bytes_invalid_float() { + assert!(!Bytes::default().validate()(&ConstValue::Number( + Number::from_f64(1.25).unwrap() + ))); + } +} diff --git a/src/core/scalar/date.rs b/src/core/scalar/date.rs index a02813de72..5d0d8ec88d 100644 --- a/src/core/scalar/date.rs +++ b/src/core/scalar/date.rs @@ -5,11 +5,11 @@ use schemars::{schema_for, JsonSchema}; use crate::core::json::JsonLike; +/// A date string, such as 2007-12-03, is compliant with the full-date format outlined in section 5.6 of the RFC 3339 (https://datatracker.ietf.org/doc/html/rfc3339) profile of the ISO 8601 standard for the representation of dates and times using the Gregorian calendar. #[derive(JsonSchema, Default)] pub struct Date { #[allow(dead_code)] #[serde(rename = "Date")] - /// A date string, such as 2007-12-03, is compliant with the full-date format outlined in section 5.6 of the RFC 3339 (https://datatracker.ietf.org/doc/html/rfc3339) profile of the ISO 8601 standard for the representation of dates and times using the Gregorian calendar. pub date: String, } @@ -24,7 +24,7 @@ impl super::Scalar for Date { } } - fn scalar(&self) -> Schema { + fn schema(&self) -> Schema { Schema::Object(schema_for!(Self).schema) } } diff --git a/src/core/scalar/email.rs b/src/core/scalar/email.rs index cb82c30442..350876e5b2 100644 --- a/src/core/scalar/email.rs +++ b/src/core/scalar/email.rs @@ -5,12 +5,12 @@ use schemars::{schema_for, JsonSchema}; use crate::core::json::JsonLike; +/// field whose value conforms to the standard internet email address format as specified in HTML Spec: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address. #[derive(JsonSchema, Default)] pub struct Email { #[allow(dead_code)] #[serde(rename = "Email")] #[schemars(schema_with = "email_schema")] - /// field whose value conforms to the standard internet email address format as specified in HTML Spec: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address. pub email: String, } @@ -34,37 +34,33 @@ impl super::Scalar for Email { false } } - fn scalar(&self) -> Schema { + fn schema(&self) -> Schema { Schema::Object(schema_for!(Self).schema) } } #[cfg(test)] mod test { - use anyhow::Result; use async_graphql_value::ConstValue; use crate::core::scalar::{Email, Scalar}; - #[tokio::test] - async fn test_email_valid_req_resp() -> Result<()> { + #[test] + fn test_email_valid_req_resp() { assert!(Email::default().validate()(&ConstValue::String( "valid@email.com".to_string() ))); - Ok(()) } - #[tokio::test] - async fn test_email_invalid() -> Result<()> { + #[test] + fn test_email_invalid() { assert!(!Email::default().validate()(&ConstValue::String( "invalid_email".to_string() ))); - Ok(()) } - #[tokio::test] - async fn test_email_invalid_const_value() -> Result<()> { + #[test] + fn test_email_invalid_const_value() { assert!(!Email::default().validate()(&ConstValue::Null)); - Ok(()) } } diff --git a/src/core/scalar/empty.rs b/src/core/scalar/empty.rs index 729ef84452..78b4322d21 100644 --- a/src/core/scalar/empty.rs +++ b/src/core/scalar/empty.rs @@ -2,11 +2,11 @@ use async_graphql_value::ConstValue; use schemars::schema::Schema; use schemars::{schema_for, JsonSchema}; +/// Empty scalar type represents an empty value. #[derive(JsonSchema, Default)] pub struct Empty { #[allow(dead_code)] #[serde(rename = "Empty")] - /// Empty scalar type represents an empty value. pub empty: (), // we don't care about the type, this is just for documentation } @@ -15,7 +15,7 @@ impl super::Scalar for Empty { |_| true } - fn scalar(&self) -> Schema { + fn schema(&self) -> Schema { Schema::Object(schema_for!(Self).schema) } } diff --git a/src/core/scalar/int128.rs b/src/core/scalar/int128.rs new file mode 100644 index 0000000000..9e8b5b4acc --- /dev/null +++ b/src/core/scalar/int128.rs @@ -0,0 +1,49 @@ +use async_graphql_value::ConstValue; +use schemars::schema::Schema; +use schemars::{schema_for, JsonSchema}; + +/// Represents signed integer type 128 bit size as string +#[derive(JsonSchema, Default)] +pub struct Int128(pub i128); + +impl super::Scalar for Int128 { + fn validate(&self) -> fn(&ConstValue) -> bool { + |value| { + if let ConstValue::String(n) = value { + n.parse::().is_ok() + } else { + false + } + } + } + fn schema(&self) -> Schema { + schema_for!(Self).schema.into() + } +} + +#[cfg(test)] +mod test { + use async_graphql_value::ConstValue; + use serde_json::Number; + + use super::Int128; + use crate::core::scalar::Scalar; + use crate::{test_scalar_invalid, test_scalar_valid}; + + test_scalar_valid! { + Int128, + ConstValue::String("100".to_string()), + ConstValue::String("-15".to_string()), + ConstValue::String(i128::MAX.to_string()) + } + + test_scalar_invalid! { + Int128, + ConstValue::Null, + ConstValue::Number(Number::from(15)), + ConstValue::Number( + Number::from_f64(1.25).unwrap() + ), + ConstValue::String(format!("{}0", i128::MAX)) + } +} diff --git a/src/core/scalar/int16.rs b/src/core/scalar/int16.rs new file mode 100644 index 0000000000..82d5c4d895 --- /dev/null +++ b/src/core/scalar/int16.rs @@ -0,0 +1,54 @@ +use async_graphql_value::ConstValue; +use schemars::schema::Schema; +use schemars::{schema_for, JsonSchema}; + +/// Represents signed integer type 16bit size +#[derive(JsonSchema, Default)] +pub struct Int16(pub i16); + +impl super::Scalar for Int16 { + fn validate(&self) -> fn(&ConstValue) -> bool { + |value| { + if let ConstValue::Number(n) = value { + if let Some(n) = n.as_i64() { + return i16::try_from(n).is_ok(); + } + } + + false + } + } + fn schema(&self) -> Schema { + schema_for!(Self).schema.into() + } +} + +#[cfg(test)] +mod test { + use async_graphql_value::ConstValue; + use serde_json::Number; + + use super::Int16; + use crate::core::scalar::Scalar; + use crate::{test_scalar_invalid, test_scalar_valid}; + + test_scalar_valid! { + Int16, + ConstValue::Number(Number::from(100u32)), + ConstValue::Number(Number::from(2 * i8::MAX as i64)), + ConstValue::Number( + Number::from(-15) + ) + } + + test_scalar_invalid! { + Int16, + ConstValue::Null, + ConstValue::Number(Number::from(i16::MAX as i64 + 1)), + ConstValue::Number(Number::from(i16::MIN as i64 - 1)), + ConstValue::Number( + Number::from_f64(1.25).unwrap() + ), + ConstValue::String("4564846".to_string()) + } +} diff --git a/src/core/scalar/int32.rs b/src/core/scalar/int32.rs new file mode 100644 index 0000000000..f78be37a73 --- /dev/null +++ b/src/core/scalar/int32.rs @@ -0,0 +1,54 @@ +use async_graphql_value::ConstValue; +use schemars::schema::Schema; +use schemars::{schema_for, JsonSchema}; + +/// Represents signed integer type 32bit size +#[derive(JsonSchema, Default)] +pub struct Int32(pub i32); + +impl super::Scalar for Int32 { + fn validate(&self) -> fn(&ConstValue) -> bool { + |value| { + if let ConstValue::Number(n) = value { + if let Some(n) = n.as_i64() { + return i32::try_from(n).is_ok(); + } + } + + false + } + } + fn schema(&self) -> Schema { + schema_for!(Self).schema.into() + } +} + +#[cfg(test)] +mod test { + use async_graphql_value::ConstValue; + use serde_json::Number; + + use super::Int32; + use crate::core::scalar::Scalar; + use crate::{test_scalar_invalid, test_scalar_valid}; + + test_scalar_valid! { + Int32, + ConstValue::Number(Number::from(100u32)), + ConstValue::Number(Number::from(i32::MAX as i64)), + ConstValue::Number( + Number::from(-15) + ) + } + + test_scalar_invalid! { + Int32, + ConstValue::Null, + ConstValue::Number(Number::from(i32::MAX as i64 + 1)), + ConstValue::Number(Number::from(i32::MIN as i64 - 1)), + ConstValue::Number( + Number::from_f64(1.25).unwrap() + ), + ConstValue::String("4564846".to_string()) + } +} diff --git a/src/core/scalar/int64.rs b/src/core/scalar/int64.rs new file mode 100644 index 0000000000..000c7c1a92 --- /dev/null +++ b/src/core/scalar/int64.rs @@ -0,0 +1,49 @@ +use async_graphql_value::ConstValue; +use schemars::schema::Schema; +use schemars::{schema_for, JsonSchema}; + +/// Represents signed integer type 64bit size as string +#[derive(JsonSchema, Default)] +pub struct Int64(pub i64); + +impl super::Scalar for Int64 { + fn validate(&self) -> fn(&ConstValue) -> bool { + |value| { + if let ConstValue::String(n) = value { + n.parse::().is_ok() + } else { + false + } + } + } + fn schema(&self) -> Schema { + schema_for!(Self).schema.into() + } +} + +#[cfg(test)] +mod test { + use async_graphql_value::ConstValue; + use serde_json::Number; + + use super::Int64; + use crate::core::scalar::Scalar; + use crate::{test_scalar_invalid, test_scalar_valid}; + + test_scalar_valid! { + Int64, + ConstValue::String("125".to_string()), + ConstValue::String("-15".to_string()), + ConstValue::String(i64::MAX.to_string()) + } + + test_scalar_invalid! { + Int64, + ConstValue::Null, + ConstValue::Number(Number::from(15)), + ConstValue::Number( + Number::from_f64(1.25).unwrap() + ), + ConstValue::String(format!("{}1", i64::MAX)) + } +} diff --git a/src/core/scalar/int8.rs b/src/core/scalar/int8.rs new file mode 100644 index 0000000000..3f0c721da7 --- /dev/null +++ b/src/core/scalar/int8.rs @@ -0,0 +1,54 @@ +use async_graphql_value::ConstValue; +use schemars::schema::Schema; +use schemars::{schema_for, JsonSchema}; + +/// Represents signed integer type 8bit size +#[derive(JsonSchema, Default)] +pub struct Int8(pub i8); + +impl super::Scalar for Int8 { + fn validate(&self) -> fn(&ConstValue) -> bool { + |value| { + if let ConstValue::Number(n) = value { + if let Some(n) = n.as_i64() { + return i8::try_from(n).is_ok(); + } + } + + false + } + } + fn schema(&self) -> Schema { + schema_for!(Self).schema.into() + } +} + +#[cfg(test)] +mod test { + use async_graphql_value::ConstValue; + use serde_json::Number; + + use super::Int8; + use crate::core::scalar::Scalar; + use crate::{test_scalar_invalid, test_scalar_valid}; + + test_scalar_valid! { + Int8, + ConstValue::Number(Number::from(100i32)), + ConstValue::Number(Number::from(127)), + ConstValue::Number( + Number::from(-15) + ) + } + + test_scalar_invalid! { + Int8, + ConstValue::Null, + ConstValue::Number(Number::from(128)), + ConstValue::Number(Number::from(-129)), + ConstValue::Number( + Number::from_f64(1.25).unwrap() + ), + ConstValue::String("4564846".to_string()) + } +} diff --git a/src/core/scalar/json.rs b/src/core/scalar/json.rs index 9692118b08..ce6818e768 100644 --- a/src/core/scalar/json.rs +++ b/src/core/scalar/json.rs @@ -2,14 +2,14 @@ use async_graphql_value::ConstValue; use schemars::schema::Schema; use schemars::{schema_for, JsonSchema}; +/// The JSON scalar type represents JSON values as specified by +/// [ECMA-404](www.ecma-international.org/publications/files/ECMA-ST/ +/// ECMA-404.pdf). #[derive(JsonSchema, Default)] #[allow(clippy::upper_case_acronyms)] pub struct JSON { #[allow(dead_code)] #[serde(rename = "JSON")] - /// The JSON scalar type represents JSON values as specified by - /// [ECMA-404](www.ecma-international.org/publications/files/ECMA-ST/ - /// ECMA-404.pdf). pub json: String, // we don't care about the type, this is just for documentation } @@ -18,7 +18,7 @@ impl super::Scalar for JSON { |_| true } - fn scalar(&self) -> Schema { + fn schema(&self) -> Schema { Schema::Object(schema_for!(Self).schema) } } diff --git a/src/core/scalar/mod.rs b/src/core/scalar/mod.rs index 3d7c8788af..7cadc6b027 100644 --- a/src/core/scalar/mod.rs +++ b/src/core/scalar/mod.rs @@ -1,15 +1,37 @@ +pub use bytes::*; pub use date::*; pub use email::*; pub use empty::*; +pub use int128::*; +pub use int16::*; +pub use int32::*; +pub use int64::*; +pub use int8::*; pub use json::*; pub use phone::*; +pub use uint128::*; +pub use uint16::*; +pub use uint32::*; +pub use uint64::*; +pub use uint8::*; pub use url::*; +mod bytes; mod date; mod email; mod empty; +mod int128; +mod int16; +mod int32; +mod int64; +mod int8; mod json; mod phone; +mod uint128; +mod uint16; +mod uint32; +mod uint64; +mod uint8; mod url; use std::collections::{HashMap, HashSet}; @@ -28,6 +50,17 @@ lazy_static! { Arc::new(Url::default()), Arc::new(JSON::default()), Arc::new(Empty::default()), + Arc::new(Int8::default()), + Arc::new(Int16::default()), + Arc::new(Int32::default()), + Arc::new(Int64::default()), + Arc::new(Int128::default()), + Arc::new(UInt8::default()), + Arc::new(UInt16::default()), + Arc::new(UInt32::default()), + Arc::new(UInt64::default()), + Arc::new(UInt128::default()), + Arc::new(Bytes::default()), ]; let mut hm = HashMap::new(); @@ -54,7 +87,7 @@ pub fn is_predefined_scalar(type_name: &str) -> bool { pub trait Scalar { fn validate(&self) -> fn(&ConstValue) -> bool; - fn scalar(&self) -> Schema; + fn schema(&self) -> Schema; fn name(&self) -> String { std::any::type_name::() .split("::") @@ -77,6 +110,36 @@ mod test { use crate::core::scalar::CUSTOM_SCALARS; + /// generates test asserts for valid scalar inputs + #[macro_export] + macro_rules! test_scalar_valid { + ($ty: ty, $($value: expr),+) => { + #[test] + fn test_scalar_valid() { + let value = <$ty>::default(); + + $( + assert!(value.validate()(&$value)); + )+ + } + }; + } + + // generates test asserts for invalid scalar inputs + #[macro_export] + macro_rules! test_scalar_invalid { + ($ty: ty, $($value: expr),+) => { + #[test] + fn test_scalar_invalid() { + let value = <$ty>::default(); + + $( + assert!(!value.validate()(&$value)); + )+ + } + }; + } + fn get_name(v: Schema) -> String { serde_json::to_value(v) .unwrap() @@ -94,7 +157,7 @@ mod test { // it's easy to accidentally add a different scalar type to the schema // this test ensures that the scalar types are correctly defined for (k, v) in CUSTOM_SCALARS.iter() { - assert_eq!(k.clone(), get_name(v.scalar())); + assert_eq!(k.clone(), get_name(v.schema())); } } } diff --git a/src/core/scalar/phone.rs b/src/core/scalar/phone.rs index 781b49a069..76da67a73a 100644 --- a/src/core/scalar/phone.rs +++ b/src/core/scalar/phone.rs @@ -4,11 +4,11 @@ use schemars::{schema_for, JsonSchema}; use crate::core::json::JsonLike; +/// A field whose value conforms to the standard E.164 format as specified in E.164 specification (https://en.wikipedia.org/wiki/E.164). #[derive(JsonSchema, Default)] pub struct PhoneNumber { #[allow(dead_code)] #[serde(rename = "PhoneNumber")] - /// A field whose value conforms to the standard E.164 format as specified in E.164 specification (https://en.wikipedia.org/wiki/E.164). pub phone_no: String, } impl super::Scalar for PhoneNumber { @@ -21,7 +21,7 @@ impl super::Scalar for PhoneNumber { false } } - fn scalar(&self) -> Schema { + fn schema(&self) -> Schema { Schema::Object(schema_for!(Self).schema) } } diff --git a/src/core/scalar/uint128.rs b/src/core/scalar/uint128.rs new file mode 100644 index 0000000000..ccc990d206 --- /dev/null +++ b/src/core/scalar/uint128.rs @@ -0,0 +1,49 @@ +use async_graphql_value::ConstValue; +use schemars::schema::Schema; +use schemars::{schema_for, JsonSchema}; + +/// Represents unsigned integer type 128bit size as string +#[derive(JsonSchema, Default)] +pub struct UInt128(pub u128); + +impl super::Scalar for UInt128 { + fn validate(&self) -> fn(&ConstValue) -> bool { + |value| { + if let ConstValue::String(n) = value { + n.parse::().is_ok() + } else { + false + } + } + } + fn schema(&self) -> Schema { + schema_for!(Self).schema.into() + } +} + +#[cfg(test)] +mod test { + use async_graphql_value::ConstValue; + use serde_json::Number; + + use super::UInt128; + use crate::core::scalar::Scalar; + use crate::{test_scalar_invalid, test_scalar_valid}; + + test_scalar_valid! { + UInt128, + ConstValue::String("100".to_string()), + ConstValue::String(u128::MAX.to_string()) + } + + test_scalar_invalid! { + UInt128, + ConstValue::Null, + ConstValue::Number(Number::from(15)), + ConstValue::Number( + Number::from_f64(1.25).unwrap() + ), + ConstValue::String("-1".to_string()), + ConstValue::String(format!("{}0", u128::MAX)) + } +} diff --git a/src/core/scalar/uint16.rs b/src/core/scalar/uint16.rs new file mode 100644 index 0000000000..e22a0ab8d8 --- /dev/null +++ b/src/core/scalar/uint16.rs @@ -0,0 +1,51 @@ +use async_graphql_value::ConstValue; +use schemars::schema::Schema; +use schemars::{schema_for, JsonSchema}; + +/// Represents unsigned integer type 16bit size +#[derive(JsonSchema, Default)] +pub struct UInt16(pub u16); + +impl super::Scalar for UInt16 { + fn validate(&self) -> fn(&ConstValue) -> bool { + |value| { + if let ConstValue::Number(n) = value { + if let Some(n) = n.as_u64() { + return u16::try_from(n).is_ok(); + } + } + + false + } + } + fn schema(&self) -> Schema { + schema_for!(Self).schema.into() + } +} + +#[cfg(test)] +mod test { + use async_graphql_value::ConstValue; + use serde_json::Number; + + use super::UInt16; + use crate::core::scalar::Scalar; + use crate::{test_scalar_invalid, test_scalar_valid}; + + test_scalar_valid! { + UInt16, + ConstValue::Number(Number::from(100u32)), + ConstValue::Number(Number::from(2 * u8::MAX as u64)) + } + + test_scalar_invalid! { + UInt16, + ConstValue::Null, + ConstValue::Number(Number::from(u16::MAX as u64 + 1)), + ConstValue::Number(Number::from(-1)), + ConstValue::Number( + Number::from_f64(1.25).unwrap() + ), + ConstValue::String("4564846".to_string()) + } +} diff --git a/src/core/scalar/uint32.rs b/src/core/scalar/uint32.rs new file mode 100644 index 0000000000..a482966ccd --- /dev/null +++ b/src/core/scalar/uint32.rs @@ -0,0 +1,51 @@ +use async_graphql_value::ConstValue; +use schemars::schema::Schema; +use schemars::{schema_for, JsonSchema}; + +/// Represents unsigned integer type 32bit size +#[derive(JsonSchema, Default)] +pub struct UInt32(pub u32); + +impl super::Scalar for UInt32 { + fn validate(&self) -> fn(&ConstValue) -> bool { + |value| { + if let ConstValue::Number(n) = value { + if let Some(n) = n.as_u64() { + return u32::try_from(n).is_ok(); + } + } + + false + } + } + fn schema(&self) -> Schema { + schema_for!(Self).schema.into() + } +} + +#[cfg(test)] +mod test { + use async_graphql_value::ConstValue; + use serde_json::Number; + + use super::UInt32; + use crate::core::scalar::Scalar; + use crate::{test_scalar_invalid, test_scalar_valid}; + + test_scalar_valid! { + UInt32, + ConstValue::Number(Number::from(100u32)), + ConstValue::Number(Number::from(u32::MAX as u64)) + } + + test_scalar_invalid! { + UInt32, + ConstValue::Null, + ConstValue::Number(Number::from(u32::MAX as u64 + 1)), + ConstValue::Number(Number::from(-1)), + ConstValue::Number( + Number::from_f64(1.25).unwrap() + ), + ConstValue::String("4564846".to_string()) + } +} diff --git a/src/core/scalar/uint64.rs b/src/core/scalar/uint64.rs new file mode 100644 index 0000000000..985f61abff --- /dev/null +++ b/src/core/scalar/uint64.rs @@ -0,0 +1,49 @@ +use async_graphql_value::ConstValue; +use schemars::schema::Schema; +use schemars::{schema_for, JsonSchema}; + +/// Represents unsigned integer type 64bit size as string +#[derive(JsonSchema, Default)] +pub struct UInt64(pub u64); + +impl super::Scalar for UInt64 { + fn validate(&self) -> fn(&ConstValue) -> bool { + |value| { + if let ConstValue::String(n) = value { + n.parse::().is_ok() + } else { + false + } + } + } + fn schema(&self) -> Schema { + schema_for!(Self).schema.into() + } +} + +#[cfg(test)] +mod test { + use async_graphql_value::ConstValue; + use serde_json::Number; + + use super::UInt64; + use crate::core::scalar::Scalar; + use crate::{test_scalar_invalid, test_scalar_valid}; + + test_scalar_valid! { + UInt64, + ConstValue::String("125".to_string()), + ConstValue::String(u64::MAX.to_string()) + } + + test_scalar_invalid! { + UInt64, + ConstValue::Null, + ConstValue::Number(Number::from(15)), + ConstValue::Number( + Number::from_f64(1.25).unwrap() + ), + ConstValue::String("-1".to_string()), + ConstValue::String(format!("{}1", u64::MAX)) + } +} diff --git a/src/core/scalar/uint8.rs b/src/core/scalar/uint8.rs new file mode 100644 index 0000000000..c7e6925448 --- /dev/null +++ b/src/core/scalar/uint8.rs @@ -0,0 +1,51 @@ +use async_graphql_value::ConstValue; +use schemars::schema::Schema; +use schemars::{schema_for, JsonSchema}; + +/// Represents unsigned integer type 8bit size +#[derive(JsonSchema, Default)] +pub struct UInt8(pub u8); + +impl super::Scalar for UInt8 { + fn validate(&self) -> fn(&ConstValue) -> bool { + |value| { + if let ConstValue::Number(n) = value { + if let Some(n) = n.as_u64() { + return u8::try_from(n).is_ok(); + } + } + + false + } + } + fn schema(&self) -> Schema { + schema_for!(Self).schema.into() + } +} + +#[cfg(test)] +mod test { + use async_graphql_value::ConstValue; + use serde_json::Number; + + use super::UInt8; + use crate::core::scalar::Scalar; + use crate::{test_scalar_invalid, test_scalar_valid}; + + test_scalar_valid! { + UInt8, + ConstValue::Number(Number::from(15)), + ConstValue::Number(Number::from(255)) + } + + test_scalar_invalid! { + UInt8, + ConstValue::Null, + ConstValue::Number(Number::from(256)), + ConstValue::Number(Number::from(-1)), + ConstValue::Number( + Number::from_f64(1.25).unwrap() + ), + ConstValue::String("4564846".to_string()) + } +} diff --git a/src/core/scalar/url.rs b/src/core/scalar/url.rs index dc19ee9eeb..1b3892b444 100644 --- a/src/core/scalar/url.rs +++ b/src/core/scalar/url.rs @@ -4,11 +4,11 @@ use schemars::{schema_for, JsonSchema}; use crate::core::json::JsonLike; +/// A field whose value conforms to the standard URL format as specified in RFC3986 (https://www.ietf.org/rfc/rfc3986.txt), and it uses real JavaScript URL objects. #[derive(JsonSchema, Default)] pub struct Url { #[allow(dead_code)] #[serde(rename = "Url")] - /// A field whose value conforms to the standard URL format as specified in RFC3986 (https://www.ietf.org/rfc/rfc3986.txt), and it uses real JavaScript URL objects. pub url: String, } @@ -22,7 +22,7 @@ impl super::Scalar for Url { false } } - fn scalar(&self) -> Schema { + fn schema(&self) -> Schema { Schema::Object(schema_for!(Self).schema) } } diff --git a/tailcall-fixtures/fixtures/protobuf/scalars.proto b/tailcall-fixtures/fixtures/protobuf/scalars.proto new file mode 100644 index 0000000000..6f4a013483 --- /dev/null +++ b/tailcall-fixtures/fixtures/protobuf/scalars.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package scalars; + +message Item { + bool boolean = 1; + bytes bytesType = 2; + double doubleNum = 3; + fixed32 fixedint32 = 4; + fixed64 fixedint64 = 5; + float floatNum = 6; + int32 integer32 = 7; + int64 integer64 = 8; + sfixed32 sfixedint32 = 9; + sfixed64 sfixedint64 = 10; + sint32 sinteger32 = 11; + sint64 sinteger64 = 12; + string str = 13; + uint32 uinteger32 = 14; + uint64 uinteger64 = 15; +} + +message Result { + repeated Item result = 1; +} + + +service Example { + rpc Get (Item) returns (Result) {} +} diff --git a/tailcall-typedefs/src/gen_gql_schema.rs b/tailcall-typedefs/src/gen_gql_schema.rs index f4090605a2..6b00774e6c 100644 --- a/tailcall-typedefs/src/gen_gql_schema.rs +++ b/tailcall-typedefs/src/gen_gql_schema.rs @@ -619,7 +619,7 @@ fn write_all_input_types( let scalar = CUSTOM_SCALARS .iter() - .map(|(k, v)| (k.clone(), v.scalar())) + .map(|(k, v)| (k.clone(), v.schema())) .collect::>(); let mut scalar_defs = BTreeMap::new(); @@ -628,11 +628,8 @@ fn write_all_input_types( let scalar_definition = obj .clone() .into_object() - .object - .as_ref() - .and_then(|a| a.properties.get(name)) - .and_then(|a| a.clone().into_object().metadata) - .and_then(|a| a.description); + .metadata + .and_then(|m| m.description); if let Some(scalar_definition) = scalar_definition { scalar_defs.insert(name.clone(), scalar_definition); diff --git a/tailcall-typedefs/src/main.rs b/tailcall-typedefs/src/main.rs index a365f7347d..e236b23d53 100644 --- a/tailcall-typedefs/src/main.rs +++ b/tailcall-typedefs/src/main.rs @@ -96,7 +96,7 @@ async fn get_updated_json() -> Result { let mut schema: RootSchema = schemars::schema_for!(Config); let scalar = CUSTOM_SCALARS .iter() - .map(|(k, v)| (k.clone(), v.scalar())) + .map(|(k, v)| (k.clone(), v.schema())) .collect::>(); schema.definitions.extend(scalar); diff --git a/tests/core/snapshots/add-field-index-list.md_client.snap b/tests/core/snapshots/add-field-index-list.md_client.snap index d5d22b778c..571eddde9f 100644 --- a/tests/core/snapshots/add-field-index-list.md_client.snap +++ b/tests/core/snapshots/add-field-index-list.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -17,6 +29,16 @@ type Query { users: [User] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/add-field-many-list.md_client.snap b/tests/core/snapshots/add-field-many-list.md_client.snap index f9e78bca84..4048b31ac1 100644 --- a/tests/core/snapshots/add-field-many-list.md_client.snap +++ b/tests/core/snapshots/add-field-many-list.md_client.snap @@ -1,6 +1,6 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type A { b: [String] @@ -8,12 +8,24 @@ type A { d: String } +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -30,6 +42,16 @@ type U { e: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/add-field-many.md_client.snap b/tests/core/snapshots/add-field-many.md_client.snap index df7485155d..2eb1c5bff1 100644 --- a/tests/core/snapshots/add-field-many.md_client.snap +++ b/tests/core/snapshots/add-field-many.md_client.snap @@ -1,7 +1,9 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email @@ -16,6 +18,16 @@ type Foo { x: X } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -24,6 +36,16 @@ type Query { user: Foo } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type X { diff --git a/tests/core/snapshots/add-field-modify.md_client.snap b/tests/core/snapshots/add-field-modify.md_client.snap index fc6f9a2307..c85859e72d 100644 --- a/tests/core/snapshots/add-field-modify.md_client.snap +++ b/tests/core/snapshots/add-field-modify.md_client.snap @@ -1,6 +1,6 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type Address { city: String @@ -8,12 +8,24 @@ type Address { zipcode: String } +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -22,6 +34,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/add-field-with-composition.md_client.snap b/tests/core/snapshots/add-field-with-composition.md_client.snap index 4523b470a5..555a3ee2e7 100644 --- a/tests/core/snapshots/add-field-with-composition.md_client.snap +++ b/tests/core/snapshots/add-field-with-composition.md_client.snap @@ -1,12 +1,14 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type Address { geo: Geo street: String } +scalar Bytes + scalar Date scalar Email @@ -18,6 +20,16 @@ type Geo { lng: String } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -28,6 +40,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/add-field-with-modify.md_client.snap b/tests/core/snapshots/add-field-with-modify.md_client.snap index 742a75a643..77525c3894 100644 --- a/tests/core/snapshots/add-field-with-modify.md_client.snap +++ b/tests/core/snapshots/add-field-with-modify.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -19,6 +31,16 @@ type Query { user2: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/add-field.md_client.snap b/tests/core/snapshots/add-field.md_client.snap index 2f1822decb..2a63a23f67 100644 --- a/tests/core/snapshots/add-field.md_client.snap +++ b/tests/core/snapshots/add-field.md_client.snap @@ -1,11 +1,13 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type Address { geo: Geo } +scalar Bytes + scalar Date scalar Email @@ -16,6 +18,16 @@ type Geo { lat: String } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -24,6 +36,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/apollo-tracing.md_client.snap b/tests/core/snapshots/apollo-tracing.md_client.snap index bc438e3a5d..5ce3b9d410 100644 --- a/tests/core/snapshots/apollo-tracing.md_client.snap +++ b/tests/core/snapshots/apollo-tracing.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { hello: String! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/async-cache-disabled.md_client.snap b/tests/core/snapshots/async-cache-disabled.md_client.snap index 2971e51959..eff8a4e184 100644 --- a/tests/core/snapshots/async-cache-disabled.md_client.snap +++ b/tests/core/snapshots/async-cache-disabled.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -24,6 +36,16 @@ type Query { posts: Post } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_client.snap b/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_client.snap index 23f1cadfd7..8d6c8379a3 100644 --- a/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_client.snap +++ b/tests/core/snapshots/async-cache-enable-multiple-resolvers.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -25,6 +37,16 @@ type Query { posts: [Post] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/async-cache-enabled.md_client.snap b/tests/core/snapshots/async-cache-enabled.md_client.snap index 7ae47b261d..16a291c915 100644 --- a/tests/core/snapshots/async-cache-enabled.md_client.snap +++ b/tests/core/snapshots/async-cache-enabled.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -24,6 +36,16 @@ type Query { posts: [Post] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/auth-basic.md_client.snap b/tests/core/snapshots/auth-basic.md_client.snap index 6e5e77070f..65f1b8eba5 100644 --- a/tests/core/snapshots/auth-basic.md_client.snap +++ b/tests/core/snapshots/auth-basic.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type Mutation { @@ -33,6 +45,16 @@ type Query { scalar: String! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/auth-jwt.md_client.snap b/tests/core/snapshots/auth-jwt.md_client.snap index 6e5e77070f..65f1b8eba5 100644 --- a/tests/core/snapshots/auth-jwt.md_client.snap +++ b/tests/core/snapshots/auth-jwt.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type Mutation { @@ -33,6 +45,16 @@ type Query { scalar: String! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/auth.md_client.snap b/tests/core/snapshots/auth.md_client.snap index 225f264c60..d74378fea7 100644 --- a/tests/core/snapshots/auth.md_client.snap +++ b/tests/core/snapshots/auth.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { data: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/batching-default.md_client.snap b/tests/core/snapshots/batching-default.md_client.snap index 7ae47b261d..16a291c915 100644 --- a/tests/core/snapshots/batching-default.md_client.snap +++ b/tests/core/snapshots/batching-default.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -24,6 +36,16 @@ type Query { posts: [Post] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/batching-disabled.md_client.snap b/tests/core/snapshots/batching-disabled.md_client.snap index 29257d2d5f..b6c5d4f1ab 100644 --- a/tests/core/snapshots/batching-disabled.md_client.snap +++ b/tests/core/snapshots/batching-disabled.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user(id: Int!): User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/batching-group-by-default.md_client.snap b/tests/core/snapshots/batching-group-by-default.md_client.snap index 7ae47b261d..16a291c915 100644 --- a/tests/core/snapshots/batching-group-by-default.md_client.snap +++ b/tests/core/snapshots/batching-group-by-default.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -24,6 +36,16 @@ type Query { posts: [Post] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/batching-group-by.md_client.snap b/tests/core/snapshots/batching-group-by.md_client.snap index 7ae47b261d..16a291c915 100644 --- a/tests/core/snapshots/batching-group-by.md_client.snap +++ b/tests/core/snapshots/batching-group-by.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -24,6 +36,16 @@ type Query { posts: [Post] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/batching-post.md_client.snap b/tests/core/snapshots/batching-post.md_client.snap index 7ae47b261d..16a291c915 100644 --- a/tests/core/snapshots/batching-post.md_client.snap +++ b/tests/core/snapshots/batching-post.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -24,6 +36,16 @@ type Query { posts: [Post] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/batching.md_client.snap b/tests/core/snapshots/batching.md_client.snap index f8c9c2fa86..eaf4ac333c 100644 --- a/tests/core/snapshots/batching.md_client.snap +++ b/tests/core/snapshots/batching.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/cache-control.md_client.snap b/tests/core/snapshots/cache-control.md_client.snap index 7c0bdf72e9..46bdca3b87 100644 --- a/tests/core/snapshots/cache-control.md_client.snap +++ b/tests/core/snapshots/cache-control.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user(id: Int): User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/caching-collision.md_client.snap b/tests/core/snapshots/caching-collision.md_client.snap index 97f888869d..ea5b821de5 100644 --- a/tests/core/snapshots/caching-collision.md_client.snap +++ b/tests/core/snapshots/caching-collision.md_client.snap @@ -1,12 +1,14 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type Bar { foo: Foo id: String! } +scalar Bytes + scalar Date scalar Email @@ -17,6 +19,16 @@ type Foo { id: Int! } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -25,6 +37,16 @@ type Query { bars: [Bar] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/caching.md_client.snap b/tests/core/snapshots/caching.md_client.snap index 4b27eea358..a545bf68da 100644 --- a/tests/core/snapshots/caching.md_client.snap +++ b/tests/core/snapshots/caching.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -28,6 +40,16 @@ type TypeCache { list: [Type] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/call-graphql-datasource.md_client.snap b/tests/core/snapshots/call-graphql-datasource.md_client.snap index 95d3e97b5f..308bea1215 100644 --- a/tests/core/snapshots/call-graphql-datasource.md_client.snap +++ b/tests/core/snapshots/call-graphql-datasource.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -25,6 +37,16 @@ type Query { user(id: Int!): User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/call-multiple-steps-piping.md_client.snap b/tests/core/snapshots/call-multiple-steps-piping.md_client.snap index deea0f695a..fbe068c947 100644 --- a/tests/core/snapshots/call-multiple-steps-piping.md_client.snap +++ b/tests/core/snapshots/call-multiple-steps-piping.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -24,6 +36,16 @@ type Query { wrap_input(input: JSON): JSON } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/call-mutation.md_client.snap b/tests/core/snapshots/call-mutation.md_client.snap index bea3b07d85..603b2346f5 100644 --- a/tests/core/snapshots/call-mutation.md_client.snap +++ b/tests/core/snapshots/call-mutation.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type Mutation { @@ -45,6 +57,16 @@ type Query { postFromUser(userId: Int!): Post } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/call-operator.md_client.snap b/tests/core/snapshots/call-operator.md_client.snap index 03ace5505d..fabc494e7a 100644 --- a/tests/core/snapshots/call-operator.md_client.snap +++ b/tests/core/snapshots/call-operator.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type News { @@ -55,6 +67,16 @@ type Query { userWithPosts: UserWithPosts } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/cors-allow-cred-false.md_client.snap b/tests/core/snapshots/cors-allow-cred-false.md_client.snap index de202e546c..94a31bb34b 100644 --- a/tests/core/snapshots/cors-allow-cred-false.md_client.snap +++ b/tests/core/snapshots/cors-allow-cred-false.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { val: Int } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/cors-allow-cred-true.md_client.snap b/tests/core/snapshots/cors-allow-cred-true.md_client.snap index de202e546c..94a31bb34b 100644 --- a/tests/core/snapshots/cors-allow-cred-true.md_client.snap +++ b/tests/core/snapshots/cors-allow-cred-true.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { val: Int } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/cors-allow-cred-vary.md_client.snap b/tests/core/snapshots/cors-allow-cred-vary.md_client.snap index de202e546c..94a31bb34b 100644 --- a/tests/core/snapshots/cors-allow-cred-vary.md_client.snap +++ b/tests/core/snapshots/cors-allow-cred-vary.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { val: Int } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/custom-headers.md_client.snap b/tests/core/snapshots/custom-headers.md_client.snap index ac555c1a8a..3706567e14 100644 --- a/tests/core/snapshots/custom-headers.md_client.snap +++ b/tests/core/snapshots/custom-headers.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { greet: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/env-value.md_client.snap b/tests/core/snapshots/env-value.md_client.snap index 17da57e235..b1b1391500 100644 --- a/tests/core/snapshots/env-value.md_client.snap +++ b/tests/core/snapshots/env-value.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -25,6 +37,16 @@ type Query { post3: Post } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/experimental-headers.md_client.snap b/tests/core/snapshots/experimental-headers.md_client.snap index 9561d92458..446c7ac88f 100644 --- a/tests/core/snapshots/experimental-headers.md_client.snap +++ b/tests/core/snapshots/experimental-headers.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { users: [User] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/graphql-dataloader-batch-request.md_client.snap b/tests/core/snapshots/graphql-dataloader-batch-request.md_client.snap index 1b6afcdb98..74966e52a2 100644 --- a/tests/core/snapshots/graphql-dataloader-batch-request.md_client.snap +++ b/tests/core/snapshots/graphql-dataloader-batch-request.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -23,6 +35,16 @@ type Query { posts: [Post] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/graphql-dataloader-no-batch-request.md_client.snap b/tests/core/snapshots/graphql-dataloader-no-batch-request.md_client.snap index 1b6afcdb98..74966e52a2 100644 --- a/tests/core/snapshots/graphql-dataloader-no-batch-request.md_client.snap +++ b/tests/core/snapshots/graphql-dataloader-no-batch-request.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -23,6 +35,16 @@ type Query { posts: [Post] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/graphql-datasource-errors.md_client.snap b/tests/core/snapshots/graphql-datasource-errors.md_client.snap index 7c0bdf72e9..46bdca3b87 100644 --- a/tests/core/snapshots/graphql-datasource-errors.md_client.snap +++ b/tests/core/snapshots/graphql-datasource-errors.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user(id: Int): User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/graphql-datasource-mutation.md_client.snap b/tests/core/snapshots/graphql-datasource-mutation.md_client.snap index 8e51a31357..067e561a83 100644 --- a/tests/core/snapshots/graphql-datasource-mutation.md_client.snap +++ b/tests/core/snapshots/graphql-datasource-mutation.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type Mutation { @@ -20,6 +32,16 @@ type Query { users: [User] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/graphql-datasource-no-args.md_client.snap b/tests/core/snapshots/graphql-datasource-no-args.md_client.snap index a9b226f953..cec27b45f4 100644 --- a/tests/core/snapshots/graphql-datasource-no-args.md_client.snap +++ b/tests/core/snapshots/graphql-datasource-no-args.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { users_list: [User] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/graphql-datasource-with-args.md_client.snap b/tests/core/snapshots/graphql-datasource-with-args.md_client.snap index 692a59db2d..1320498699 100644 --- a/tests/core/snapshots/graphql-datasource-with-args.md_client.snap +++ b/tests/core/snapshots/graphql-datasource-with-args.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -22,6 +34,16 @@ type Query { user(id: Int): User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/grpc-batch.md_client.snap b/tests/core/snapshots/grpc-batch.md_client.snap index da34171517..ed55cdf8bc 100644 --- a/tests/core/snapshots/grpc-batch.md_client.snap +++ b/tests/core/snapshots/grpc-batch.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type News { @@ -35,6 +47,16 @@ type Query { newsById(news: NewsInput!): News! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/grpc-error.md_client.snap b/tests/core/snapshots/grpc-error.md_client.snap index da34171517..ed55cdf8bc 100644 --- a/tests/core/snapshots/grpc-error.md_client.snap +++ b/tests/core/snapshots/grpc-error.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type News { @@ -35,6 +47,16 @@ type Query { newsById(news: NewsInput!): News! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/grpc-map.md_client.snap b/tests/core/snapshots/grpc-map.md_client.snap index 841ab58b81..4058f81271 100644 --- a/tests/core/snapshots/grpc-map.md_client.snap +++ b/tests/core/snapshots/grpc-map.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { map__MapService__GetMap(mapRequest: map__MapRequest!): map__MapResponse! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url input map__MapRequest { diff --git a/tests/core/snapshots/grpc-override-url-from-upstream.md_client.snap b/tests/core/snapshots/grpc-override-url-from-upstream.md_client.snap index da34171517..ed55cdf8bc 100644 --- a/tests/core/snapshots/grpc-override-url-from-upstream.md_client.snap +++ b/tests/core/snapshots/grpc-override-url-from-upstream.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type News { @@ -35,6 +47,16 @@ type Query { newsById(news: NewsInput!): News! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/grpc-proto-with-same-package.md_client.snap b/tests/core/snapshots/grpc-proto-with-same-package.md_client.snap index 4629912e16..12b100cc59 100644 --- a/tests/core/snapshots/grpc-proto-with-same-package.md_client.snap +++ b/tests/core/snapshots/grpc-proto-with-same-package.md_client.snap @@ -1,11 +1,13 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type Bar { bar: String } +scalar Bytes + scalar Date scalar Email @@ -16,6 +18,16 @@ type Foo { foo: String } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -25,6 +37,16 @@ type Query { foo: Foo! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/grpc-reflection.md_client.snap b/tests/core/snapshots/grpc-reflection.md_client.snap index 66514b8486..37b5fafa6c 100644 --- a/tests/core/snapshots/grpc-reflection.md_client.snap +++ b/tests/core/snapshots/grpc-reflection.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type News { @@ -27,6 +39,16 @@ type Query { news: NewsData! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/grpc-simple.md_client.snap b/tests/core/snapshots/grpc-simple.md_client.snap index 6c1871f044..52412795d5 100644 --- a/tests/core/snapshots/grpc-simple.md_client.snap +++ b/tests/core/snapshots/grpc-simple.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type Mutation { @@ -43,6 +55,16 @@ type Query { newsById(news: NewsInput!): News! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/grpc-url-from-upstream.md_client.snap b/tests/core/snapshots/grpc-url-from-upstream.md_client.snap index da34171517..ed55cdf8bc 100644 --- a/tests/core/snapshots/grpc-url-from-upstream.md_client.snap +++ b/tests/core/snapshots/grpc-url-from-upstream.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type News { @@ -35,6 +47,16 @@ type Query { newsById(news: NewsInput!): News! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/https.md_client.snap b/tests/core/snapshots/https.md_client.snap index fd73bea4ae..7aade2684d 100644 --- a/tests/core/snapshots/https.md_client.snap +++ b/tests/core/snapshots/https.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { firstUser: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/inline-field.md_client.snap b/tests/core/snapshots/inline-field.md_client.snap index db581c1494..9f91c85d71 100644 --- a/tests/core/snapshots/inline-field.md_client.snap +++ b/tests/core/snapshots/inline-field.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/inline-index-list.md_client.snap b/tests/core/snapshots/inline-index-list.md_client.snap index 6e9d6172f2..4f8f04b1cf 100644 --- a/tests/core/snapshots/inline-index-list.md_client.snap +++ b/tests/core/snapshots/inline-index-list.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { username: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/inline-many-list.md_client.snap b/tests/core/snapshots/inline-many-list.md_client.snap index 019b06f8e1..7ed584d650 100644 --- a/tests/core/snapshots/inline-many-list.md_client.snap +++ b/tests/core/snapshots/inline-many-list.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -23,6 +35,16 @@ type U { e: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/inline-many.md_client.snap b/tests/core/snapshots/inline-many.md_client.snap index a063ed8484..0621adb925 100644 --- a/tests/core/snapshots/inline-many.md_client.snap +++ b/tests/core/snapshots/inline-many.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/io-cache.md_client.snap b/tests/core/snapshots/io-cache.md_client.snap index 322138d3b6..af27d621b9 100644 --- a/tests/core/snapshots/io-cache.md_client.snap +++ b/tests/core/snapshots/io-cache.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -24,6 +36,16 @@ type Query { posts: [Post] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/js-directive.md_client.snap b/tests/core/snapshots/js-directive.md_client.snap index d940d29bb5..2ba4a925f2 100644 --- a/tests/core/snapshots/js-directive.md_client.snap +++ b/tests/core/snapshots/js-directive.md_client.snap @@ -2,12 +2,24 @@ source: tests/core/spec.rs expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { hello: User! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/jsonplaceholder-call-post.md_client.snap b/tests/core/snapshots/jsonplaceholder-call-post.md_client.snap index d7e7d165cd..9f2b5df9c8 100644 --- a/tests/core/snapshots/jsonplaceholder-call-post.md_client.snap +++ b/tests/core/snapshots/jsonplaceholder-call-post.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -25,6 +37,16 @@ type Query { users: [User] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/modified-field.md_client.snap b/tests/core/snapshots/modified-field.md_client.snap index bd0fb67424..d83070e6df 100644 --- a/tests/core/snapshots/modified-field.md_client.snap +++ b/tests/core/snapshots/modified-field.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/mutation-put.md_client.snap b/tests/core/snapshots/mutation-put.md_client.snap index 5e1c62be04..ea4a604ba1 100644 --- a/tests/core/snapshots/mutation-put.md_client.snap +++ b/tests/core/snapshots/mutation-put.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type Mutation { @@ -34,6 +46,16 @@ type Query { firstUser: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/mutation.md_client.snap b/tests/core/snapshots/mutation.md_client.snap index 9ee31d491b..b43a43e389 100644 --- a/tests/core/snapshots/mutation.md_client.snap +++ b/tests/core/snapshots/mutation.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type Mutation { @@ -33,6 +45,16 @@ type Query { firstUser: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/n-plus-one-list.md_client.snap b/tests/core/snapshots/n-plus-one-list.md_client.snap index 908564ca06..81bc8cc30d 100644 --- a/tests/core/snapshots/n-plus-one-list.md_client.snap +++ b/tests/core/snapshots/n-plus-one-list.md_client.snap @@ -1,6 +1,6 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type Bar { foo: [Foo] @@ -8,6 +8,8 @@ type Bar { id: Int! } +scalar Bytes + scalar Date scalar Email @@ -20,6 +22,16 @@ type Foo { name: String! } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -29,6 +41,16 @@ type Query { foos: [Foo] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/n-plus-one.md_client.snap b/tests/core/snapshots/n-plus-one.md_client.snap index 908564ca06..81bc8cc30d 100644 --- a/tests/core/snapshots/n-plus-one.md_client.snap +++ b/tests/core/snapshots/n-plus-one.md_client.snap @@ -1,6 +1,6 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type Bar { foo: [Foo] @@ -8,6 +8,8 @@ type Bar { id: Int! } +scalar Bytes + scalar Date scalar Email @@ -20,6 +22,16 @@ type Foo { name: String! } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -29,6 +41,16 @@ type Query { foos: [Foo] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/nested-objects.md_client.snap b/tests/core/snapshots/nested-objects.md_client.snap index 51c3f1f41b..70e2db280c 100644 --- a/tests/core/snapshots/nested-objects.md_client.snap +++ b/tests/core/snapshots/nested-objects.md_client.snap @@ -1,12 +1,14 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type Address { geo: Geo street: String } +scalar Bytes + scalar Date scalar Email @@ -18,6 +20,16 @@ type Geo { lng: String } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -26,6 +38,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/nesting-level3.md_client.snap b/tests/core/snapshots/nesting-level3.md_client.snap index d628fab7b1..07f81e7f82 100644 --- a/tests/core/snapshots/nesting-level3.md_client.snap +++ b/tests/core/snapshots/nesting-level3.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -28,6 +40,16 @@ type Todo { completed: Boolean } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/nullable-arg-query.md_client.snap b/tests/core/snapshots/nullable-arg-query.md_client.snap index d0ed27e549..2fff4705ae 100644 --- a/tests/core/snapshots/nullable-arg-query.md_client.snap +++ b/tests/core/snapshots/nullable-arg-query.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { users(id: ID): [User] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/omit-index-list.md_client.snap b/tests/core/snapshots/omit-index-list.md_client.snap index 6e9d6172f2..4f8f04b1cf 100644 --- a/tests/core/snapshots/omit-index-list.md_client.snap +++ b/tests/core/snapshots/omit-index-list.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { username: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/omit-many.md_client.snap b/tests/core/snapshots/omit-many.md_client.snap index 6517675baa..7407d19fd8 100644 --- a/tests/core/snapshots/omit-many.md_client.snap +++ b/tests/core/snapshots/omit-many.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/omit-resolved-by-parent.md_client.snap b/tests/core/snapshots/omit-resolved-by-parent.md_client.snap index db581c1494..9f91c85d71 100644 --- a/tests/core/snapshots/omit-resolved-by-parent.md_client.snap +++ b/tests/core/snapshots/omit-resolved-by-parent.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/recursive-type-json.md_client.snap b/tests/core/snapshots/recursive-type-json.md_client.snap index 0ba4af7c68..af1bb03cbf 100644 --- a/tests/core/snapshots/recursive-type-json.md_client.snap +++ b/tests/core/snapshots/recursive-type-json.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user(id: Int!): User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/recursive-types.md_client.snap b/tests/core/snapshots/recursive-types.md_client.snap index c68cd69419..eef4e80e55 100644 --- a/tests/core/snapshots/recursive-types.md_client.snap +++ b/tests/core/snapshots/recursive-types.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/ref-other-nested.md_client.snap b/tests/core/snapshots/ref-other-nested.md_client.snap index 0157e58887..7ecdc1de33 100644 --- a/tests/core/snapshots/ref-other-nested.md_client.snap +++ b/tests/core/snapshots/ref-other-nested.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { firstUser: User1 } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/ref-other.md_client.snap b/tests/core/snapshots/ref-other.md_client.snap index 1e285d9604..841d0ccbab 100644 --- a/tests/core/snapshots/ref-other.md_client.snap +++ b/tests/core/snapshots/ref-other.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { firstUser: User1 } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/rename-field.md_client.snap b/tests/core/snapshots/rename-field.md_client.snap index dc9cb4bcd1..c84b063525 100644 --- a/tests/core/snapshots/rename-field.md_client.snap +++ b/tests/core/snapshots/rename-field.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -17,6 +29,16 @@ type Query { user2: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/request-to-upstream-batching.md_client.snap b/tests/core/snapshots/request-to-upstream-batching.md_client.snap index a39792ca85..716fa2de78 100644 --- a/tests/core/snapshots/request-to-upstream-batching.md_client.snap +++ b/tests/core/snapshots/request-to-upstream-batching.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user(id: Int!): User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/resolve-with-headers.md_client.snap b/tests/core/snapshots/resolve-with-headers.md_client.snap index b80ed2b615..8a6f5ee622 100644 --- a/tests/core/snapshots/resolve-with-headers.md_client.snap +++ b/tests/core/snapshots/resolve-with-headers.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -23,6 +35,16 @@ type Query { post1: Post } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/resolve-with-vars.md_client.snap b/tests/core/snapshots/resolve-with-vars.md_client.snap index e7f00943cb..b7b80a3876 100644 --- a/tests/core/snapshots/resolve-with-vars.md_client.snap +++ b/tests/core/snapshots/resolve-with-vars.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user: [User] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/resolved-by-parent.md_client.snap b/tests/core/snapshots/resolved-by-parent.md_client.snap index db581c1494..9f91c85d71 100644 --- a/tests/core/snapshots/resolved-by-parent.md_client.snap +++ b/tests/core/snapshots/resolved-by-parent.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/rest-api-error.md_client.snap b/tests/core/snapshots/rest-api-error.md_client.snap index b6fca1b4e8..8a80bfe8be 100644 --- a/tests/core/snapshots/rest-api-error.md_client.snap +++ b/tests/core/snapshots/rest-api-error.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user(id: Int!): User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/rest-api-post.md_client.snap b/tests/core/snapshots/rest-api-post.md_client.snap index b6fca1b4e8..8a80bfe8be 100644 --- a/tests/core/snapshots/rest-api-post.md_client.snap +++ b/tests/core/snapshots/rest-api-post.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user(id: Int!): User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/rest-api.md_client.snap b/tests/core/snapshots/rest-api.md_client.snap index b6fca1b4e8..8a80bfe8be 100644 --- a/tests/core/snapshots/rest-api.md_client.snap +++ b/tests/core/snapshots/rest-api.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user(id: Int!): User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/showcase.md_client.snap b/tests/core/snapshots/showcase.md_client.snap index 7d841d7546..493380b084 100644 --- a/tests/core/snapshots/showcase.md_client.snap +++ b/tests/core/snapshots/showcase.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { not_user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/simple-graphql.md_client.snap b/tests/core/snapshots/simple-graphql.md_client.snap index f8c9c2fa86..eaf4ac333c 100644 --- a/tests/core/snapshots/simple-graphql.md_client.snap +++ b/tests/core/snapshots/simple-graphql.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/simple-query.md_client.snap b/tests/core/snapshots/simple-query.md_client.snap index fd73bea4ae..7aade2684d 100644 --- a/tests/core/snapshots/simple-query.md_client.snap +++ b/tests/core/snapshots/simple-query.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { firstUser: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/test-add-field-list.md_client.snap b/tests/core/snapshots/test-add-field-list.md_client.snap index 63732a49c6..fcd3f6b7eb 100644 --- a/tests/core/snapshots/test-add-field-list.md_client.snap +++ b/tests/core/snapshots/test-add-field-list.md_client.snap @@ -1,6 +1,6 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type A { b: B @@ -10,6 +10,8 @@ type B { c: String } +scalar Bytes + scalar Date scalar Email @@ -20,6 +22,16 @@ type Foo { a: A } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -29,6 +41,16 @@ type Query { foo: [Foo] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-add-field.md_client.snap b/tests/core/snapshots/test-add-field.md_client.snap index 3926ab5706..df57435509 100644 --- a/tests/core/snapshots/test-add-field.md_client.snap +++ b/tests/core/snapshots/test-add-field.md_client.snap @@ -1,6 +1,6 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type A { b: B @@ -10,6 +10,8 @@ type B { c: String } +scalar Bytes + scalar Date scalar Email @@ -20,6 +22,16 @@ type Foo { a: A } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -29,6 +41,16 @@ type Query { foo: Foo } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-add-link-to-empty-config.md_client.snap b/tests/core/snapshots/test-add-link-to-empty-config.md_client.snap index bd1061e7db..629d00935f 100644 --- a/tests/core/snapshots/test-add-link-to-empty-config.md_client.snap +++ b/tests/core/snapshots/test-add-link-to-empty-config.md_client.snap @@ -1,7 +1,9 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email @@ -13,6 +15,16 @@ enum Foo { BAZ } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -22,6 +34,16 @@ type Query { hello: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-batching-group-by.md_client.snap b/tests/core/snapshots/test-batching-group-by.md_client.snap index 7ae47b261d..16a291c915 100644 --- a/tests/core/snapshots/test-batching-group-by.md_client.snap +++ b/tests/core/snapshots/test-batching-group-by.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -24,6 +36,16 @@ type Query { posts: [Post] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/test-cache.md_client.snap b/tests/core/snapshots/test-cache.md_client.snap index f8c9c2fa86..eaf4ac333c 100644 --- a/tests/core/snapshots/test-cache.md_client.snap +++ b/tests/core/snapshots/test-cache.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/test-custom-scalar.md_client.snap b/tests/core/snapshots/test-custom-scalar.md_client.snap index f15f9a6a3d..b457ffc920 100644 --- a/tests/core/snapshots/test-custom-scalar.md_client.snap +++ b/tests/core/snapshots/test-custom-scalar.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar Json @@ -18,6 +30,16 @@ type Query { foo: [Json] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-custom-types.md_client.snap b/tests/core/snapshots/test-custom-types.md_client.snap index a7308e2bf3..19d687208c 100644 --- a/tests/core/snapshots/test-custom-types.md_client.snap +++ b/tests/core/snapshots/test-custom-types.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type Mut { @@ -33,6 +45,16 @@ type Que { posts: [Post] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-description-many.md_client.snap b/tests/core/snapshots/test-description-many.md_client.snap index c21889cb2e..afb3cc6df6 100644 --- a/tests/core/snapshots/test-description-many.md_client.snap +++ b/tests/core/snapshots/test-description-many.md_client.snap @@ -1,6 +1,6 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type Bar { """ @@ -9,12 +9,24 @@ type Bar { baz: String } +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -26,6 +38,16 @@ type Query { foo: Bar } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-enum-default.md_client.snap b/tests/core/snapshots/test-enum-default.md_client.snap index 8af62223b3..f7f2314d0e 100644 --- a/tests/core/snapshots/test-enum-default.md_client.snap +++ b/tests/core/snapshots/test-enum-default.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type News { @@ -31,6 +43,16 @@ enum Status { PUBLISHED } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-enum-description.md_client.snap b/tests/core/snapshots/test-enum-description.md_client.snap index 6386550a39..463ccdcb09 100644 --- a/tests/core/snapshots/test-enum-description.md_client.snap +++ b/tests/core/snapshots/test-enum-description.md_client.snap @@ -1,8 +1,9 @@ --- source: tests/core/spec.rs -assertion_line: 273 -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email @@ -17,6 +18,16 @@ enum Foo { BAZ } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -25,6 +36,16 @@ type Query { foo(val: String!): Foo } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-enum.md_client.snap b/tests/core/snapshots/test-enum.md_client.snap index 5f025dcda8..cea59d077c 100644 --- a/tests/core/snapshots/test-enum.md_client.snap +++ b/tests/core/snapshots/test-enum.md_client.snap @@ -1,7 +1,9 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email @@ -13,6 +15,16 @@ enum Foo { BAZ } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -21,6 +33,16 @@ type Query { foo(val: String!): Foo } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-expr-scalar-as-string.md_client.snap b/tests/core/snapshots/test-expr-scalar-as-string.md_client.snap index 8c6e84e6f9..6aaf9eb14b 100644 --- a/tests/core/snapshots/test-expr-scalar-as-string.md_client.snap +++ b/tests/core/snapshots/test-expr-scalar-as-string.md_client.snap @@ -2,6 +2,8 @@ source: tests/core/spec.rs expression: formatted --- +scalar Bytes + scalar Date scalar Email @@ -17,6 +19,16 @@ type Entry { str: String } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type Nested { @@ -33,6 +45,16 @@ type Query { entry: Entry } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-expr-with-mustache.md_client.snap b/tests/core/snapshots/test-expr-with-mustache.md_client.snap index 563b3e26f4..24636cc62d 100644 --- a/tests/core/snapshots/test-expr-with-mustache.md_client.snap +++ b/tests/core/snapshots/test-expr-with-mustache.md_client.snap @@ -1,6 +1,6 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type A { a: Int @@ -15,6 +15,8 @@ type BC { g: Boolean } +scalar Bytes + type D { e: Int } @@ -25,6 +27,16 @@ scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -33,6 +45,16 @@ type Query { a: A } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-expr.md_client.snap b/tests/core/snapshots/test-expr.md_client.snap index 246536f601..0441ab22db 100644 --- a/tests/core/snapshots/test-expr.md_client.snap +++ b/tests/core/snapshots/test-expr.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { hello: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-graphqlsource.md_client.snap b/tests/core/snapshots/test-graphqlsource.md_client.snap index 17bdbf61cc..7a8ab8e3e6 100644 --- a/tests/core/snapshots/test-graphqlsource.md_client.snap +++ b/tests/core/snapshots/test-graphqlsource.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -22,6 +34,16 @@ type Query { post(id: Int!): Post } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/test-grpc.md_client.snap b/tests/core/snapshots/test-grpc.md_client.snap index 72b8b8dccc..8e001772e2 100644 --- a/tests/core/snapshots/test-grpc.md_client.snap +++ b/tests/core/snapshots/test-grpc.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type News { @@ -36,6 +48,16 @@ type Query { newsByIdBatch(news: NewsInput!): News! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-http-baseurl.md_client.snap b/tests/core/snapshots/test-http-baseurl.md_client.snap index 9387751799..d95906b893 100644 --- a/tests/core/snapshots/test-http-baseurl.md_client.snap +++ b/tests/core/snapshots/test-http-baseurl.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -17,6 +29,16 @@ type Query { foo: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-http-headers.md_client.snap b/tests/core/snapshots/test-http-headers.md_client.snap index 374d170a70..dee9bbfb2f 100644 --- a/tests/core/snapshots/test-http-headers.md_client.snap +++ b/tests/core/snapshots/test-http-headers.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { foo: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-http-tmpl.md_client.snap b/tests/core/snapshots/test-http-tmpl.md_client.snap index 5f5cff8b2f..b65810f8dc 100644 --- a/tests/core/snapshots/test-http-tmpl.md_client.snap +++ b/tests/core/snapshots/test-http-tmpl.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -22,6 +34,16 @@ type Query { posts: [Post] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/test-http-with-mustache-expr.md_client.snap b/tests/core/snapshots/test-http-with-mustache-expr.md_client.snap index 3ab88b233b..5da5d83175 100644 --- a/tests/core/snapshots/test-http-with-mustache-expr.md_client.snap +++ b/tests/core/snapshots/test-http-with-mustache-expr.md_client.snap @@ -1,6 +1,6 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type A { a: Int @@ -12,6 +12,8 @@ type BC { f: Boolean } +scalar Bytes + type D { e: Int } @@ -22,6 +24,16 @@ scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -30,6 +42,16 @@ type Query { a: A } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-http.md_client.snap b/tests/core/snapshots/test-http.md_client.snap index 1d4b0f34bb..24db8e3811 100644 --- a/tests/core/snapshots/test-http.md_client.snap +++ b/tests/core/snapshots/test-http.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { foo: [User] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/test-inline-list.md_client.snap b/tests/core/snapshots/test-inline-list.md_client.snap index 9308d7eedc..8936211fb0 100644 --- a/tests/core/snapshots/test-inline-list.md_client.snap +++ b/tests/core/snapshots/test-inline-list.md_client.snap @@ -1,17 +1,29 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type B { c: String } +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -20,6 +32,16 @@ type Query { foo: B } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-inline.md_client.snap b/tests/core/snapshots/test-inline.md_client.snap index 9308d7eedc..8936211fb0 100644 --- a/tests/core/snapshots/test-inline.md_client.snap +++ b/tests/core/snapshots/test-inline.md_client.snap @@ -1,17 +1,29 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type B { c: String } +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -20,6 +32,16 @@ type Query { foo: B } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-input-documentation.md_client.snap b/tests/core/snapshots/test-input-documentation.md_client.snap index f411bf7804..7b37aea04d 100644 --- a/tests/core/snapshots/test-input-documentation.md_client.snap +++ b/tests/core/snapshots/test-input-documentation.md_client.snap @@ -1,8 +1,9 @@ --- source: tests/core/spec.rs -assertion_line: 278 expression: formatted --- +scalar Bytes + scalar Date scalar Email @@ -19,6 +20,16 @@ input Foo { id: Int } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type Mutation { @@ -40,6 +51,16 @@ type Query { postFromFoo(id: Int!): Post } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-interface-from-json.md_client.snap b/tests/core/snapshots/test-interface-from-json.md_client.snap index c62d23aa48..7bb6b11fa4 100644 --- a/tests/core/snapshots/test-interface-from-json.md_client.snap +++ b/tests/core/snapshots/test-interface-from-json.md_client.snap @@ -1,12 +1,14 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type B implements IA { a: String b: String } +scalar Bytes + scalar Date scalar Email @@ -17,6 +19,16 @@ interface IA { a: String } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -25,6 +37,16 @@ type Query { bar: B } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-interface-result.md_client.snap b/tests/core/snapshots/test-interface-result.md_client.snap index f374cc4b72..e43cf3d990 100644 --- a/tests/core/snapshots/test-interface-result.md_client.snap +++ b/tests/core/snapshots/test-interface-result.md_client.snap @@ -1,12 +1,14 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type B implements IA { a: String b: String } +scalar Bytes + scalar Date scalar Email @@ -17,6 +19,16 @@ interface IA { a: String } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -25,6 +37,16 @@ type Query { bar: IA } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-interface.md_client.snap b/tests/core/snapshots/test-interface.md_client.snap index c62d23aa48..7bb6b11fa4 100644 --- a/tests/core/snapshots/test-interface.md_client.snap +++ b/tests/core/snapshots/test-interface.md_client.snap @@ -1,12 +1,14 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type B implements IA { a: String b: String } +scalar Bytes + scalar Date scalar Email @@ -17,6 +19,16 @@ interface IA { a: String } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -25,6 +37,16 @@ type Query { bar: B } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-js-request-response-2.md_client.snap b/tests/core/snapshots/test-js-request-response-2.md_client.snap index 234db86478..90a4cca8cd 100644 --- a/tests/core/snapshots/test-js-request-response-2.md_client.snap +++ b/tests/core/snapshots/test-js-request-response-2.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -17,6 +29,16 @@ type Query { hi: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-js-request-response.md_client.snap b/tests/core/snapshots/test-js-request-response.md_client.snap index 234db86478..90a4cca8cd 100644 --- a/tests/core/snapshots/test-js-request-response.md_client.snap +++ b/tests/core/snapshots/test-js-request-response.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -17,6 +29,16 @@ type Query { hi: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-merge-right-with-link-config.md_client.snap b/tests/core/snapshots/test-merge-right-with-link-config.md_client.snap index 40d931b741..3a9b315e28 100644 --- a/tests/core/snapshots/test-merge-right-with-link-config.md_client.snap +++ b/tests/core/snapshots/test-merge-right-with-link-config.md_client.snap @@ -1,7 +1,9 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email @@ -12,6 +14,16 @@ type Foo { bar: String } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -20,6 +32,16 @@ type Query { foo: Foo } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-merge-server-sdl.md_client.snap b/tests/core/snapshots/test-merge-server-sdl.md_client.snap index 1d4b0f34bb..24db8e3811 100644 --- a/tests/core/snapshots/test-merge-server-sdl.md_client.snap +++ b/tests/core/snapshots/test-merge-server-sdl.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { foo: [User] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/test-modify.md_client.snap b/tests/core/snapshots/test-modify.md_client.snap index 8d46ada4a5..5213ba5686 100644 --- a/tests/core/snapshots/test-modify.md_client.snap +++ b/tests/core/snapshots/test-modify.md_client.snap @@ -1,7 +1,9 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email @@ -12,6 +14,16 @@ input Foo { bar: String } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -20,6 +32,16 @@ type Query { data(input: Foo): String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-multi-interface.md_client.snap b/tests/core/snapshots/test-multi-interface.md_client.snap index b3e62e99f4..ec01020efe 100644 --- a/tests/core/snapshots/test-multi-interface.md_client.snap +++ b/tests/core/snapshots/test-multi-interface.md_client.snap @@ -1,12 +1,14 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type B implements IA & IB { a: String b: String } +scalar Bytes + scalar Date scalar Email @@ -21,6 +23,16 @@ interface IB { b: String } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -29,6 +41,16 @@ type Query { bar: B } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-nested-input.md_client.snap b/tests/core/snapshots/test-nested-input.md_client.snap index 5ea104885a..8086638063 100644 --- a/tests/core/snapshots/test-nested-input.md_client.snap +++ b/tests/core/snapshots/test-nested-input.md_client.snap @@ -1,6 +1,6 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- input A { b: B @@ -10,6 +10,8 @@ input B { c: C } +scalar Bytes + input C { d: D } @@ -24,6 +26,16 @@ scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -32,6 +44,16 @@ type Query { a(a: A!): X } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type X { diff --git a/tests/core/snapshots/test-nested-link.md_client.snap b/tests/core/snapshots/test-nested-link.md_client.snap index 7d41dd312a..84bd324efb 100644 --- a/tests/core/snapshots/test-nested-link.md_client.snap +++ b/tests/core/snapshots/test-nested-link.md_client.snap @@ -1,7 +1,9 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email @@ -13,6 +15,16 @@ enum Foo { BAZ } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -28,6 +40,16 @@ type Query { post(id: Int!): Post } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/test-nested-value.md_client.snap b/tests/core/snapshots/test-nested-value.md_client.snap index fc6739e632..d38870c445 100644 --- a/tests/core/snapshots/test-nested-value.md_client.snap +++ b/tests/core/snapshots/test-nested-value.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -21,6 +33,16 @@ type Query { posts: [Post] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/test-null-in-array.md_client.snap b/tests/core/snapshots/test-null-in-array.md_client.snap index b452d72d74..1ef2eba909 100644 --- a/tests/core/snapshots/test-null-in-array.md_client.snap +++ b/tests/core/snapshots/test-null-in-array.md_client.snap @@ -1,7 +1,9 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + type Company { id: ID name: String @@ -13,6 +15,16 @@ scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -21,6 +33,16 @@ type Query { hi(id: ID!): [Company] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-null-in-object.md_client.snap b/tests/core/snapshots/test-null-in-object.md_client.snap index b2bd05a708..474efcfdbe 100644 --- a/tests/core/snapshots/test-null-in-object.md_client.snap +++ b/tests/core/snapshots/test-null-in-object.md_client.snap @@ -1,7 +1,9 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + type Company { id: ID name: String @@ -13,6 +15,16 @@ scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -21,6 +33,16 @@ type Query { hi(id: ID!): Company } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-omit-list.md_client.snap b/tests/core/snapshots/test-omit-list.md_client.snap index 9308d7eedc..8936211fb0 100644 --- a/tests/core/snapshots/test-omit-list.md_client.snap +++ b/tests/core/snapshots/test-omit-list.md_client.snap @@ -1,17 +1,29 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type B { c: String } +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -20,6 +32,16 @@ type Query { foo: B } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-omit.md_client.snap b/tests/core/snapshots/test-omit.md_client.snap index 9308d7eedc..8936211fb0 100644 --- a/tests/core/snapshots/test-omit.md_client.snap +++ b/tests/core/snapshots/test-omit.md_client.snap @@ -1,17 +1,29 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type B { c: String } +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -20,6 +32,16 @@ type Query { foo: B } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-params-as-body.md_client.snap b/tests/core/snapshots/test-params-as-body.md_client.snap index 926203748b..18064f21a1 100644 --- a/tests/core/snapshots/test-params-as-body.md_client.snap +++ b/tests/core/snapshots/test-params-as-body.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { firstUser(id: Int, name: String): User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/test-query-documentation.md_client.snap b/tests/core/snapshots/test-query-documentation.md_client.snap index bfbe74a5fb..a656df94b7 100644 --- a/tests/core/snapshots/test-query-documentation.md_client.snap +++ b/tests/core/snapshots/test-query-documentation.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -19,6 +31,16 @@ type Query { foo: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-query.md_client.snap b/tests/core/snapshots/test-query.md_client.snap index 374d170a70..dee9bbfb2f 100644 --- a/tests/core/snapshots/test-query.md_client.snap +++ b/tests/core/snapshots/test-query.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { foo: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-ref-other.md_client.snap b/tests/core/snapshots/test-ref-other.md_client.snap index 78c6f4d5f1..4f115007ca 100644 --- a/tests/core/snapshots/test-ref-other.md_client.snap +++ b/tests/core/snapshots/test-ref-other.md_client.snap @@ -1,7 +1,9 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email @@ -12,6 +14,16 @@ type InPost { get: [Post] } +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -25,6 +37,16 @@ type Query { posts: InPost } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-scalars-builtin.md_client.snap b/tests/core/snapshots/test-scalars-builtin.md_client.snap index 62a92bfa89..84849b273a 100644 --- a/tests/core/snapshots/test-scalars-builtin.md_client.snap +++ b/tests/core/snapshots/test-scalars-builtin.md_client.snap @@ -2,12 +2,24 @@ source: tests/core/spec.rs expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -20,6 +32,16 @@ type Query { string(x: String!): String! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-scalars-integers.md_0.snap b/tests/core/snapshots/test-scalars-integers.md_0.snap new file mode 100644 index 0000000000..2a25ec8e33 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_0.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "a": -125, + "b": 120 + } + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_1.snap b/tests/core/snapshots/test-scalars-integers.md_1.snap new file mode 100644 index 0000000000..6def729548 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_1.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "a": -1250, + "b": 32767 + } + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_10.snap b/tests/core/snapshots/test-scalars-integers.md_10.snap new file mode 100644 index 0000000000..182fa51189 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_10.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"Int8\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "a" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_11.snap b/tests/core/snapshots/test-scalars-integers.md_11.snap new file mode 100644 index 0000000000..43cb390a6f --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_11.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"Int16\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "a" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_12.snap b/tests/core/snapshots/test-scalars-integers.md_12.snap new file mode 100644 index 0000000000..c17790102d --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_12.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"Int32\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "a" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_13.snap b/tests/core/snapshots/test-scalars-integers.md_13.snap new file mode 100644 index 0000000000..5ec8943cfd --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_13.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"Int64\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "a" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_14.snap b/tests/core/snapshots/test-scalars-integers.md_14.snap new file mode 100644 index 0000000000..4cb6dda6c3 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_14.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"Int128\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "a" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_15.snap b/tests/core/snapshots/test-scalars-integers.md_15.snap new file mode 100644 index 0000000000..3fcc674209 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_15.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"UInt8\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "a" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_16.snap b/tests/core/snapshots/test-scalars-integers.md_16.snap new file mode 100644 index 0000000000..eff516b2e0 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_16.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"UInt16\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "a" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_17.snap b/tests/core/snapshots/test-scalars-integers.md_17.snap new file mode 100644 index 0000000000..9f1436b96b --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_17.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"UInt32\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "a" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_18.snap b/tests/core/snapshots/test-scalars-integers.md_18.snap new file mode 100644 index 0000000000..d8d6497ac2 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_18.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"UInt64\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "a" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_19.snap b/tests/core/snapshots/test-scalars-integers.md_19.snap new file mode 100644 index 0000000000..4f8df4c842 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_19.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"UInt128\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "a" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_2.snap b/tests/core/snapshots/test-scalars-integers.md_2.snap new file mode 100644 index 0000000000..555aa36411 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_2.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "a": -125, + "b": 2147483645 + } + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_3.snap b/tests/core/snapshots/test-scalars-integers.md_3.snap new file mode 100644 index 0000000000..5ec8943cfd --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_3.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"Int64\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "a" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_4.snap b/tests/core/snapshots/test-scalars-integers.md_4.snap new file mode 100644 index 0000000000..4cb6dda6c3 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_4.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"Int128\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "a" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_5.snap b/tests/core/snapshots/test-scalars-integers.md_5.snap new file mode 100644 index 0000000000..14eea1b242 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_5.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "a": 0, + "b": 255 + } + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_6.snap b/tests/core/snapshots/test-scalars-integers.md_6.snap new file mode 100644 index 0000000000..97668132c8 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_6.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "a": 32767, + "b": 63535 + } + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_7.snap b/tests/core/snapshots/test-scalars-integers.md_7.snap new file mode 100644 index 0000000000..6b11162cea --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_7.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "a": 65535, + "b": 4294967295 + } + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_8.snap b/tests/core/snapshots/test-scalars-integers.md_8.snap new file mode 100644 index 0000000000..d8d6497ac2 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_8.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"UInt64\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "a" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_9.snap b/tests/core/snapshots/test-scalars-integers.md_9.snap new file mode 100644 index 0000000000..4cb6dda6c3 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_9.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"Int128\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "a" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars-integers.md_client.snap b/tests/core/snapshots/test-scalars-integers.md_client.snap new file mode 100644 index 0000000000..417d34abcf --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_client.snap @@ -0,0 +1,54 @@ +--- +source: tests/core/spec.rs +expression: formatted +--- +scalar Bytes + +scalar Date + +scalar Email + +scalar Empty + +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + +scalar JSON + +scalar PhoneNumber + +type Query { + int128(x: Int128): Int128 + int16(x: Int16): Int16 + int32(x: Int32): Int32 + int64(x: Int64): Int64 + int8(x: Int8): Int8 + uint128(x: UInt128): UInt128 + uint16(x: UInt16): UInt16 + uint32(x: UInt32): UInt32 + uint64(x: UInt64): UInt64 + uint8(x: UInt8): UInt8 +} + +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-scalars-integers.md_merged.snap b/tests/core/snapshots/test-scalars-integers.md_merged.snap new file mode 100644 index 0000000000..fbaa2637f8 --- /dev/null +++ b/tests/core/snapshots/test-scalars-integers.md_merged.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: formatter +--- +schema @server(hostname: "localhost", port: 8000) @upstream { + query: Query +} + +type Query { + int128(x: Int128): Int128 @expr(body: "{{.args.x}}") + int16(x: Int16): Int16 @expr(body: "{{.args.x}}") + int32(x: Int32): Int32 @expr(body: "{{.args.x}}") + int64(x: Int64): Int64 @expr(body: "{{.args.x}}") + int8(x: Int8): Int8 @expr(body: "{{.args.x}}") + uint128(x: UInt128): UInt128 @expr(body: "{{.args.x}}") + uint16(x: UInt16): UInt16 @expr(body: "{{.args.x}}") + uint32(x: UInt32): UInt32 @expr(body: "{{.args.x}}") + uint64(x: UInt64): UInt64 @expr(body: "{{.args.x}}") + uint8(x: UInt8): UInt8 @expr(body: "{{.args.x}}") +} diff --git a/tests/core/snapshots/test-scalars-validation.md_client.snap b/tests/core/snapshots/test-scalars-validation.md_client.snap index afff69f642..4c2eeb5f56 100644 --- a/tests/core/snapshots/test-scalars-validation.md_client.snap +++ b/tests/core/snapshots/test-scalars-validation.md_client.snap @@ -2,12 +2,24 @@ source: tests/core/spec.rs expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -17,6 +29,16 @@ type Query { emailOutput: Email! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-scalars.md_10.snap b/tests/core/snapshots/test-scalars.md_10.snap new file mode 100644 index 0000000000..4ab684e59e --- /dev/null +++ b/tests/core/snapshots/test-scalars.md_10.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"Url\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "url" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars.md_11.snap b/tests/core/snapshots/test-scalars.md_11.snap new file mode 100644 index 0000000000..22b5ad0dd1 --- /dev/null +++ b/tests/core/snapshots/test-scalars.md_11.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"Bytes\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "bytes" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars.md_5.snap b/tests/core/snapshots/test-scalars.md_5.snap index f05fab41e1..c8930b71ec 100644 --- a/tests/core/snapshots/test-scalars.md_5.snap +++ b/tests/core/snapshots/test-scalars.md_5.snap @@ -8,20 +8,8 @@ expression: response "content-type": "application/json" }, "body": { - "data": null, - "errors": [ - { - "message": "internal: invalid value for scalar \"Email\", expected \"FieldValue::Value\"", - "locations": [ - { - "line": 1, - "column": 3 - } - ], - "path": [ - "email" - ] - } - ] + "data": { + "bytes": "test" + } } } diff --git a/tests/core/snapshots/test-scalars.md_6.snap b/tests/core/snapshots/test-scalars.md_6.snap index 8b0ea58a37..f05fab41e1 100644 --- a/tests/core/snapshots/test-scalars.md_6.snap +++ b/tests/core/snapshots/test-scalars.md_6.snap @@ -11,7 +11,7 @@ expression: response "data": null, "errors": [ { - "message": "internal: invalid value for scalar \"PhoneNumber\", expected \"FieldValue::Value\"", + "message": "internal: invalid value for scalar \"Email\", expected \"FieldValue::Value\"", "locations": [ { "line": 1, @@ -19,7 +19,7 @@ expression: response } ], "path": [ - "phone" + "email" ] } ] diff --git a/tests/core/snapshots/test-scalars.md_8.snap b/tests/core/snapshots/test-scalars.md_8.snap index 31a1a3502f..8b0ea58a37 100644 --- a/tests/core/snapshots/test-scalars.md_8.snap +++ b/tests/core/snapshots/test-scalars.md_8.snap @@ -11,7 +11,7 @@ expression: response "data": null, "errors": [ { - "message": "internal: invalid value for scalar \"Date\", expected \"FieldValue::Value\"", + "message": "internal: invalid value for scalar \"PhoneNumber\", expected \"FieldValue::Value\"", "locations": [ { "line": 1, @@ -19,7 +19,7 @@ expression: response } ], "path": [ - "date" + "phone" ] } ] diff --git a/tests/core/snapshots/test-scalars.md_9.snap b/tests/core/snapshots/test-scalars.md_9.snap index 4ab684e59e..31a1a3502f 100644 --- a/tests/core/snapshots/test-scalars.md_9.snap +++ b/tests/core/snapshots/test-scalars.md_9.snap @@ -11,7 +11,7 @@ expression: response "data": null, "errors": [ { - "message": "internal: invalid value for scalar \"Url\", expected \"FieldValue::Value\"", + "message": "internal: invalid value for scalar \"Date\", expected \"FieldValue::Value\"", "locations": [ { "line": 1, @@ -19,7 +19,7 @@ expression: response } ], "path": [ - "url" + "date" ] } ] diff --git a/tests/core/snapshots/test-scalars.md_client.snap b/tests/core/snapshots/test-scalars.md_client.snap index 1d0bcc5ebf..0b5e47a2ed 100644 --- a/tests/core/snapshots/test-scalars.md_client.snap +++ b/tests/core/snapshots/test-scalars.md_client.snap @@ -1,27 +1,50 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- scalar AnyScalar +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber type Query { any(value: AnyScalar!): AnyScalar + bytes(value: Bytes): Bytes date(value: Date!): Date! email(value: Email!): Email! phone(value: PhoneNumber!): PhoneNumber! url(value: Url!): Url! } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-scalars.md_merged.snap b/tests/core/snapshots/test-scalars.md_merged.snap index 716063f91c..9d04c99207 100644 --- a/tests/core/snapshots/test-scalars.md_merged.snap +++ b/tests/core/snapshots/test-scalars.md_merged.snap @@ -1,6 +1,6 @@ --- source: tests/core/spec.rs -expression: merged +expression: formatter --- schema @server(hostname: "localhost", port: 8000) @upstream { query: Query @@ -12,6 +12,7 @@ scalar Email type Query { any(value: AnyScalar!): AnyScalar @expr(body: "{{.args.value}}") + bytes(value: Bytes): Bytes @expr(body: "{{.args.value}}") date(value: Date!): Date! @expr(body: "{{.args.value}}") email(value: Email!): Email! @expr(body: "{{.args.value}}") phone(value: PhoneNumber!): PhoneNumber! @expr(body: "{{.args.value}}") diff --git a/tests/core/snapshots/test-server-vars.md_client.snap b/tests/core/snapshots/test-server-vars.md_client.snap index 374d170a70..dee9bbfb2f 100644 --- a/tests/core/snapshots/test-server-vars.md_client.snap +++ b/tests/core/snapshots/test-server-vars.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { foo: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-set-cookie-headers.md_client.snap b/tests/core/snapshots/test-set-cookie-headers.md_client.snap index cb11214253..eb9d1f2c59 100644 --- a/tests/core/snapshots/test-set-cookie-headers.md_client.snap +++ b/tests/core/snapshots/test-set-cookie-headers.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user(id: Int!): User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/test-static-value.md_client.snap b/tests/core/snapshots/test-static-value.md_client.snap index fd73bea4ae..7aade2684d 100644 --- a/tests/core/snapshots/test-static-value.md_client.snap +++ b/tests/core/snapshots/test-static-value.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { firstUser: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/test-tag.md_client.snap b/tests/core/snapshots/test-tag.md_client.snap index c38b4b5100..efba43a715 100644 --- a/tests/core/snapshots/test-tag.md_client.snap +++ b/tests/core/snapshots/test-tag.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON type NEWS { @@ -31,6 +43,16 @@ type Query { news: NEWS } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-union.md_client.snap b/tests/core/snapshots/test-union.md_client.snap index fa316b3e59..8b88d56059 100644 --- a/tests/core/snapshots/test-union.md_client.snap +++ b/tests/core/snapshots/test-union.md_client.snap @@ -1,11 +1,13 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- type Bar { bar: String } +scalar Bytes + scalar Date scalar Email @@ -18,6 +20,16 @@ type Foo { union FooBar = Bar | Foo +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -26,6 +38,16 @@ type Query { foo: FooBar } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-upstream-headers.md_client.snap b/tests/core/snapshots/test-upstream-headers.md_client.snap index 5ba4bd7bd2..8efa223217 100644 --- a/tests/core/snapshots/test-upstream-headers.md_client.snap +++ b/tests/core/snapshots/test-upstream-headers.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -20,6 +32,16 @@ type Query { posts: [Post] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/test-upstream.md_client.snap b/tests/core/snapshots/test-upstream.md_client.snap index 246536f601..0441ab22db 100644 --- a/tests/core/snapshots/test-upstream.md_client.snap +++ b/tests/core/snapshots/test-upstream.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { hello: String } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url schema { diff --git a/tests/core/snapshots/upstream-batching.md_client.snap b/tests/core/snapshots/upstream-batching.md_client.snap index 7c0bdf72e9..46bdca3b87 100644 --- a/tests/core/snapshots/upstream-batching.md_client.snap +++ b/tests/core/snapshots/upstream-batching.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user(id: Int): User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/upstream-fail-request.md_client.snap b/tests/core/snapshots/upstream-fail-request.md_client.snap index f8c9c2fa86..eaf4ac333c 100644 --- a/tests/core/snapshots/upstream-fail-request.md_client.snap +++ b/tests/core/snapshots/upstream-fail-request.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/with-args-url.md_client.snap b/tests/core/snapshots/with-args-url.md_client.snap index a39792ca85..716fa2de78 100644 --- a/tests/core/snapshots/with-args-url.md_client.snap +++ b/tests/core/snapshots/with-args-url.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user(id: Int!): User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/with-args.md_client.snap b/tests/core/snapshots/with-args.md_client.snap index 4b24b72bbe..7aa744ad13 100644 --- a/tests/core/snapshots/with-args.md_client.snap +++ b/tests/core/snapshots/with-args.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -16,6 +28,16 @@ type Query { user(id: Int!): [User] } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/core/snapshots/with-nesting.md_client.snap b/tests/core/snapshots/with-nesting.md_client.snap index 762317c8a7..bceab701e3 100644 --- a/tests/core/snapshots/with-nesting.md_client.snap +++ b/tests/core/snapshots/with-nesting.md_client.snap @@ -1,13 +1,25 @@ --- source: tests/core/spec.rs -expression: client +expression: formatted --- +scalar Bytes + scalar Date scalar Email scalar Empty +scalar Int128 + +scalar Int16 + +scalar Int32 + +scalar Int64 + +scalar Int8 + scalar JSON scalar PhoneNumber @@ -23,6 +35,16 @@ type Query { user: User } +scalar UInt128 + +scalar UInt16 + +scalar UInt32 + +scalar UInt64 + +scalar UInt8 + scalar Url type User { diff --git a/tests/execution/test-scalars-integers.md b/tests/execution/test-scalars-integers.md new file mode 100644 index 0000000000..7991cdfc9e --- /dev/null +++ b/tests/execution/test-scalars-integers.md @@ -0,0 +1,127 @@ +# Test scalars related to integer representation + +```graphql @config +schema @server(port: 8000, hostname: "localhost") { + query: Query +} + +type Query { + int8(x: Int8): Int8 @expr(body: "{{.args.x}}") + int16(x: Int16): Int16 @expr(body: "{{.args.x}}") + int32(x: Int32): Int32 @expr(body: "{{.args.x}}") + int64(x: Int64): Int64 @expr(body: "{{.args.x}}") + int128(x: Int128): Int128 @expr(body: "{{.args.x}}") + + uint8(x: UInt8): UInt8 @expr(body: "{{.args.x}}") + uint16(x: UInt16): UInt16 @expr(body: "{{.args.x}}") + uint32(x: UInt32): UInt32 @expr(body: "{{.args.x}}") + uint64(x: UInt64): UInt64 @expr(body: "{{.args.x}}") + uint128(x: UInt128): UInt128 @expr(body: "{{.args.x}}") +} +``` + +```yml @test +# TODO: some of the tests do not work properly due to the issue https://github.com/tailcallhq/tailcall/issues/2039 + +# Valid value tests +- method: POST + url: http://localhost:8000/graphql + body: + query: "{ a: int8(x: -125) b: int8(x: 120) }" + +- method: POST + url: http://localhost:8000/graphql + body: + query: "{ a: int16(x: -1250) b: int16(x: 32767) }" + +- method: POST + url: http://localhost:8000/graphql + body: + query: "{ a: int32(x: -125) b: int32(x: 2147483645) }" + +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ a: int64(x: "-128") b: int64(x: "9223372036854775") }' + +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ a: int128(x: "-125") b: int128(x: "1701411834604692317316873037158841057") }' + +- method: POST + url: http://localhost:8000/graphql + body: + query: "{ a: uint8(x: 0) b: uint8(x: 255) }" + +- method: POST + url: http://localhost:8000/graphql + body: + query: "{ a: uint16(x: 32767) b: uint16(x: 63535) }" + +- method: POST + url: http://localhost:8000/graphql + body: + query: "{ a: uint32(x: 65535) b: uint32(x: 4294967295) }" + +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ a: uint64(x: "0") b: uint64(x: "18446744073709551615") }' + +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ a: int128(x: "1564") b: int128(x: "340282366920938463463374607431768211455") }' + +# Invalid value test +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ a: int8(x: 3214) b: int8(x: "48") }' + +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ a: int16(x: -42768) b: int16(x: "48") }' + +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ a: int32(x: 4147483647) b: int32(x: "48") }' + +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ a: int64(x: 3214) b: int64(x: "92233720368547758090") }' + +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ a: int128(x: 3214) b: int128(x: "3170141183460469231731687303715884105727") }' + +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ a: uint8(x: 280) b: uint8(x: "48") }' + +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ a: uint16(x: -1) b: uint16(x: "48") }' + +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ a: uint32(x: 8294967295) b: uint32(x: "48") }' + +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ a: uint64(x: "-1") b: uint64(x: "3518446744073709551615") }' + +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ a: uint128(x: -1) b: uint128(x: "640282366920938463463374607431768211455") }' +``` diff --git a/tests/execution/test-scalars.md b/tests/execution/test-scalars.md index 82283c0302..7ec62ad71a 100644 --- a/tests/execution/test-scalars.md +++ b/tests/execution/test-scalars.md @@ -1,7 +1,7 @@ -# test-scalar-email +# Test scalars ```graphql @config -# this is already defined scalars in tailcall +# these are pre-defined scalars in Tailcall scalar Email # this is custom scalars in config @@ -17,6 +17,7 @@ type Query { date(value: Date!): Date! @expr(body: "{{.args.value}}") url(value: Url!): Url! @expr(body: "{{.args.value}}") any(value: AnyScalar!): AnyScalar @expr(body: "{{.args.value}}") + bytes(value: Bytes): Bytes @expr(body: "{{.args.value}}") } ``` @@ -46,6 +47,11 @@ type Query { body: query: '{ any1: any(value: { test: "abc" } ), any2: any(value: "string-value") }' +- method: POST + url: http://localhost:8000/graphql + body: + query: '{ bytes(value: "test") }' + # Invalid value test - method: POST @@ -69,4 +75,9 @@ type Query { url: http://localhost:8000/graphql body: query: '{ url(value: "invalid_host") }' + +- method: POST + url: http://localhost:8000/graphql + body: + query: "{ bytes(value: 44864) }" ```