diff --git a/src/All.slnx b/src/All.slnx index 39c317bdc08..b111d55449d 100644 --- a/src/All.slnx +++ b/src/All.slnx @@ -129,6 +129,7 @@ + diff --git a/src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/_Service.cs b/src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/_Service.cs index de05668ef9a..7a7c0c6c5e2 100644 --- a/src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/_Service.cs +++ b/src/HotChocolate/ApolloFederation/src/ApolloFederation/Types/_Service.cs @@ -18,5 +18,5 @@ public sealed class _Service { [GraphQLName(WellKnownFieldNames.Sdl)] public string GetSdl(Schema schema) - => SchemaPrinter.Print(schema); + => schema.ToString(); } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Schema_Snapshot.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Schema_Snapshot.graphql index 88ae4f1bbf6..479f0ee071f 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Schema_Snapshot.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Schema_Snapshot.graphql @@ -3,6 +3,17 @@ schema query: Query } +type Query { + product(id: ID!): Product + _service: _Service! + _entities(representations: [_Any!]!): [_Entity]! +} + +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + type Product @key(fields: "id") @key(fields: "sku package") @@ -24,25 +35,20 @@ type ProductVariation { id: ID! } -type Query { - product(id: ID!): Product - _service: _Service! - _entities(representations: [_Any!]!): [_Entity]! -} - type User @key(fields: "email") { email: ID! @external totalProductsCreated: Int @external } -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! -} - "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Product | User +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Directive to indicate that a field is owned by another service, for example via Apollo federation." directive @external on OBJECT | FIELD_DEFINITION @@ -59,9 +65,3 @@ directive @link( "Used to annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the federation gateway." directive @provides(fields: FieldSet!) on FIELD_DEFINITION - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Subgraph_SDL.snap b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Subgraph_SDL.snap index 88ae4f1bbf6..479f0ee071f 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Subgraph_SDL.snap +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Subgraph_SDL.snap @@ -3,6 +3,17 @@ schema query: Query } +type Query { + product(id: ID!): Product + _service: _Service! + _entities(representations: [_Any!]!): [_Entity]! +} + +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + type Product @key(fields: "id") @key(fields: "sku package") @@ -24,25 +35,20 @@ type ProductVariation { id: ID! } -type Query { - product(id: ID!): Product - _service: _Service! - _entities(representations: [_Any!]!): [_Entity]! -} - type User @key(fields: "email") { email: ID! @external totalProductsCreated: Int @external } -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! -} - "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Product | User +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Directive to indicate that a field is owned by another service, for example via Apollo federation." directive @external on OBJECT | FIELD_DEFINITION @@ -59,9 +65,3 @@ directive @link( "Used to annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the federation gateway." directive @provides(fields: FieldSet!) on FIELD_DEFINITION - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Schema_Snapshot.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Schema_Snapshot.graphql index e84aafc4808..8380c62c776 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Schema_Snapshot.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Schema_Snapshot.graphql @@ -3,6 +3,17 @@ schema query: Query } +type Query { + product(id: ID!): Product + _service: _Service! + _entities(representations: [_Any!]!): [_Entity]! +} + +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + type Product @key(fields: "id") @key(fields: "sku package") @@ -24,25 +35,20 @@ type ProductVariation { id: ID! } -type Query { - product(id: ID!): Product - _service: _Service! - _entities(representations: [_Any!]!): [_Entity]! -} - type User @key(fields: "email") { email: ID! @external totalProductsCreated: Int @external } -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! -} - "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Product | User +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Directive to indicate that a field is owned by another service, for example via Apollo federation." directive @external on OBJECT | FIELD_DEFINITION @@ -59,9 +65,3 @@ directive @link( "Used to annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the federation gateway." directive @provides(fields: FieldSet!) on FIELD_DEFINITION - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Subgraph_SDL.snap b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Subgraph_SDL.snap index e84aafc4808..8380c62c776 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Subgraph_SDL.snap +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Subgraph_SDL.snap @@ -3,6 +3,17 @@ schema query: Query } +type Query { + product(id: ID!): Product + _service: _Service! + _entities(representations: [_Any!]!): [_Entity]! +} + +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + type Product @key(fields: "id") @key(fields: "sku package") @@ -24,25 +35,20 @@ type ProductVariation { id: ID! } -type Query { - product(id: ID!): Product - _service: _Service! - _entities(representations: [_Any!]!): [_Entity]! -} - type User @key(fields: "email") { email: ID! @external totalProductsCreated: Int @external } -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! -} - "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Product | User +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Directive to indicate that a field is owned by another service, for example via Apollo federation." directive @external on OBJECT | FIELD_DEFINITION @@ -59,9 +65,3 @@ directive @link( "Used to annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the federation gateway." directive @provides(fields: FieldSet!) on FIELD_DEFINITION - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldAnnotationBased.graphql index 2428d60aa35..32a6b0feb7c 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldAnnotationBased.graphql @@ -8,27 +8,27 @@ type Query { _entities(representations: [_Any!]!): [_Entity]! } -type User @key(fields: "id") { - id: Int! - idCode: String! @external -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type User @key(fields: "id") { + id: Int! + idCode: String! @external +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = User -"Directive to indicate that a field is owned by another service, for example via Apollo federation." -directive @external on FIELD_DEFINITION - -"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." -directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE - "The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." scalar _Any "Scalar representing a set of fields." scalar _FieldSet + +"Directive to indicate that a field is owned by another service, for example via Apollo federation." +directive @external on FIELD_DEFINITION + +"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." +directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldCodeFirst.graphql index 2937449425e..d47ef53794a 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldCodeFirst.graphql @@ -8,27 +8,27 @@ type Query { _entities(representations: [_Any!]!): [_Entity]! } -type User @key(fields: "id") { - id: Int - idCode: String @external -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type User @key(fields: "id") { + id: Int + idCode: String @external +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = User -"Directive to indicate that a field is owned by another service, for example via Apollo federation." -directive @external on FIELD_DEFINITION - -"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." -directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE - "The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." scalar _Any "Scalar representing a set of fields." scalar _FieldSet + +"Directive to indicate that a field is owned by another service, for example via Apollo federation." +directive @external on FIELD_DEFINITION + +"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." +directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql index a6901f2678f..0d3c4b0abbe 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql @@ -8,23 +8,23 @@ type QueryOfTestTypePropertyDirective { _entities(representations: [_Any!]!): [_Entity]! } -type TestTypePropertyDirective @key(fields: "id") { - id: Int! -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type TestTypePropertyDirective @key(fields: "id") { + id: Int! +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = TestTypePropertyDirective -"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." -directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE - "The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." scalar _Any "Scalar representing a set of fields." scalar _FieldSet + +"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." +directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql index 1f2167cb22d..2d5f019bf96 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql @@ -8,24 +8,24 @@ type QueryOfTestTypePropertyDirectives { _entities(representations: [_Any!]!): [_Entity]! } -type TestTypePropertyDirectives @key(fields: "id name") { - id: Int! - name: String! -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type TestTypePropertyDirectives @key(fields: "id name") { + id: Int! + name: String! +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = TestTypePropertyDirectives -"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." -directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE - "The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." scalar _Any "Scalar representing a set of fields." scalar _FieldSet + +"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." +directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql index 78f37f8883b..b57daba5f39 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql @@ -8,23 +8,23 @@ type QueryOfTestTypeClassDirective { _entities(representations: [_Any!]!): [_Entity]! } -type TestTypeClassDirective @key(fields: "id") { - id: Int! -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type TestTypeClassDirective @key(fields: "id") { + id: Int! +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = TestTypeClassDirective -"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." -directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE - "The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." scalar _Any "Scalar representing a set of fields." scalar _FieldSet + +"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." +directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql index 35722f053a2..ed39b06c3fe 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql @@ -8,24 +8,24 @@ type Query { _entities(representations: [_Any!]!): [_Entity]! } -type TestType @key(fields: "id") { - id: Int - name: String -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type TestType @key(fields: "id") { + id: Int + name: String +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = TestType -"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." -directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE - "The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." scalar _Any "Scalar representing a set of fields." scalar _FieldSet + +"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." +directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql index 851a9759ba1..cfd22ba7adf 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql @@ -2,37 +2,37 @@ schema { query: Query } -type Product { - name: String! -} - type Query { someField(id: Int!): Review! _service: _Service! _entities(representations: [_Any!]!): [_Entity]! } -type Review @key(fields: "id") { - id: Int! - product: Product! @provides(fields: "name") -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } -"Union of all types that key directive applied. This information is needed by the Apollo federation gateway." -union _Entity = Review +type Product { + name: String! +} -"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." -directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE +type Review @key(fields: "id") { + id: Int! + product: Product! @provides(fields: "name") +} -"Used to annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the federation gateway." -directive @provides(fields: _FieldSet!) on FIELD_DEFINITION +"Union of all types that key directive applied. This information is needed by the Apollo federation gateway." +union _Entity = Review "The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." scalar _Any "Scalar representing a set of fields." scalar _FieldSet + +"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." +directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE + +"Used to annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the federation gateway." +directive @provides(fields: _FieldSet!) on FIELD_DEFINITION diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql index 1ab6d59a71f..f0bcac045f1 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql @@ -2,37 +2,37 @@ schema { query: Query } -type Product { - name: String -} - type Query { someField(a: Int): Review _service: _Service! _entities(representations: [_Any!]!): [_Entity]! } -type Review @key(fields: "id") { - id: Int - product: Product @provides(fields: "name") -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } -"Union of all types that key directive applied. This information is needed by the Apollo federation gateway." -union _Entity = Review +type Product { + name: String +} -"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." -directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE +type Review @key(fields: "id") { + id: Int + product: Product @provides(fields: "name") +} -"Used to annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the federation gateway." -directive @provides(fields: _FieldSet!) on FIELD_DEFINITION +"Union of all types that key directive applied. This information is needed by the Apollo federation gateway." +union _Entity = Review "The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." scalar _Any "Scalar representing a set of fields." scalar _FieldSet + +"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." +directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE + +"Used to annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the federation gateway." +directive @provides(fields: _FieldSet!) on FIELD_DEFINITION diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql index 9da48a0cbfc..75e64ff83d9 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql @@ -2,37 +2,37 @@ schema { query: Query } -type Product { - name: String! -} - type Query { someField(id: Int!): Review! _service: _Service! _entities(representations: [_Any!]!): [_Entity]! } -type Review @key(fields: "id") { - id: Int! - product: Product! @requires(fields: "id") -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } -"Union of all types that key directive applied. This information is needed by the Apollo federation gateway." -union _Entity = Review +type Product { + name: String! +} -"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." -directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE +type Review @key(fields: "id") { + id: Int! + product: Product! @requires(fields: "id") +} -"Used to annotate the required input fieldset from a base type for a resolver." -directive @requires(fields: _FieldSet!) on FIELD_DEFINITION +"Union of all types that key directive applied. This information is needed by the Apollo federation gateway." +union _Entity = Review "The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." scalar _Any "Scalar representing a set of fields." scalar _FieldSet + +"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." +directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE + +"Used to annotate the required input fieldset from a base type for a resolver." +directive @requires(fields: _FieldSet!) on FIELD_DEFINITION diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql index 89253a5a240..7330935b2c6 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/Legacy/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql @@ -2,37 +2,37 @@ schema { query: Query } -type Product { - name: String -} - type Query { someField(a: Int): Review _service: _Service! _entities(representations: [_Any!]!): [_Entity]! } -type Review @key(fields: "id") { - id: Int - product: Product @requires(fields: "id") -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } -"Union of all types that key directive applied. This information is needed by the Apollo federation gateway." -union _Entity = Review +type Product { + name: String +} -"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." -directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE +type Review @key(fields: "id") { + id: Int + product: Product @requires(fields: "id") +} -"Used to annotate the required input fieldset from a base type for a resolver." -directive @requires(fields: _FieldSet!) on FIELD_DEFINITION +"Union of all types that key directive applied. This information is needed by the Apollo federation gateway." +union _Entity = Review "The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." scalar _Any "Scalar representing a set of fields." scalar _FieldSet + +"Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." +directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE + +"Used to annotate the required input fieldset from a base type for a resolver." +directive @requires(fields: _FieldSet!) on FIELD_DEFINITION diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ComposeDirectiveTests.ExportDirectiveUsingNameCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ComposeDirectiveTests.ExportDirectiveUsingNameCodeFirst.graphql index 00b5c26469a..791178f4e83 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ComposeDirectiveTests.ExportDirectiveUsingNameCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ComposeDirectiveTests.ExportDirectiveUsingNameCodeFirst.graphql @@ -5,10 +5,6 @@ schema query: Query } -type Address @key(fields: "field") { - field: String! @custom -} - type Query { _service: _Service! _entities(representations: [_Any!]!): [_Entity]! @@ -19,9 +15,19 @@ type _Service { sdl: String! } +type Address @key(fields: "field") { + field: String! @custom +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Address +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Marks underlying custom directive to be included in the Supergraph schema." directive @composeDirective(name: String!) repeatable on SCHEMA @@ -37,9 +43,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ComposeDirectiveTests.ExportDirectiveUsingTypeCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ComposeDirectiveTests.ExportDirectiveUsingTypeCodeFirst.graphql index 00b5c26469a..791178f4e83 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ComposeDirectiveTests.ExportDirectiveUsingTypeCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ComposeDirectiveTests.ExportDirectiveUsingTypeCodeFirst.graphql @@ -5,10 +5,6 @@ schema query: Query } -type Address @key(fields: "field") { - field: String! @custom -} - type Query { _service: _Service! _entities(representations: [_Any!]!): [_Entity]! @@ -19,9 +15,19 @@ type _Service { sdl: String! } +type Address @key(fields: "field") { + field: String! @custom +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Address +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Marks underlying custom directive to be included in the Supergraph schema." directive @composeDirective(name: String!) repeatable on SCHEMA @@ -37,9 +43,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldAnnotationBased.graphql index 734d8ba22b6..79382406492 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldAnnotationBased.graphql @@ -3,31 +3,37 @@ schema query: Query } -type Address @external { - street: String! - city: String! -} - type Query { entity(id: Int!): User! _service: _Service! _entities(representations: [_Any!]!): [_Entity]! } +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + +type Address @external { + street: String! + city: String! +} + type User @key(fields: "id") { id: Int! idCode: String! @external address: Address! @external } -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! -} - "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = User +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Directive to indicate that a field is owned by another service, for example via Apollo federation." directive @external on OBJECT | FIELD_DEFINITION @@ -41,9 +47,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldCodeFirst.graphql index 538aa8d4069..5efe62db49e 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldCodeFirst.graphql @@ -3,31 +3,37 @@ schema query: Query } -type Address @external { - street: String - city: String -} - type Query { entity(id: Int): User _service: _Service! _entities(representations: [_Any!]!): [_Entity]! } +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + +type Address @external { + street: String + city: String +} + type User @key(fields: "id") { id: Int idCode: String @external address: Address @external } -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! -} - "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = User +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Directive to indicate that a field is owned by another service, for example via Apollo federation." directive @external on OBJECT | FIELD_DEFINITION @@ -41,9 +47,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql index deaba9678a8..8f1e1aa41e0 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql @@ -9,18 +9,24 @@ type QueryOfTestTypePropertyDirective { _entities(representations: [_Any!]!): [_Entity]! } -type TestTypePropertyDirective @key(fields: "id") { - id: Int! -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type TestTypePropertyDirective @key(fields: "id") { + id: Int! +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = TestTypePropertyDirective +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -31,9 +37,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql index 1add763d836..29eed3ef4c2 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql @@ -9,19 +9,25 @@ type QueryOfTestTypePropertyDirectives { _entities(representations: [_Any!]!): [_Entity]! } -type TestTypePropertyDirectives @key(fields: "id name") { - id: Int! - name: String! -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type TestTypePropertyDirectives @key(fields: "id name") { + id: Int! + name: String! +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = TestTypePropertyDirectives +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -32,9 +38,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql index 69e496183ac..51230474421 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql @@ -3,29 +3,35 @@ schema query: QueryOfTestTypeClassDirective } -interface ITestTypeInterfaceDirective @key(fields: "id") { - id: Int! -} - type QueryOfTestTypeClassDirective { someField(id: Int!): TestTypeClassDirective! _service: _Service! _entities(representations: [_Any!]!): [_Entity]! } +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + type TestTypeClassDirective implements ITestTypeInterfaceDirective @key(fields: "id") { id: Int! } -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! +interface ITestTypeInterfaceDirective @key(fields: "id") { + id: Int! } "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = TestTypeClassDirective +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -36,9 +42,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql index cac856d46fc..0efb6b576f2 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql @@ -3,30 +3,36 @@ schema query: Query } -interface ITestType @key(fields: "id") { - id: Int - name: String -} - type Query { someField(a: Int): ITestType _service: _Service! _entities(representations: [_Any!]!): [_Entity]! } +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + type TestType implements ITestType @key(fields: "id") { id: Int name: String } -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! +interface ITestType @key(fields: "id") { + id: Int + name: String } "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = TestType +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -37,9 +43,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql index 07bebb636de..c5667ea81cb 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql @@ -9,18 +9,24 @@ type QueryOfTestTypeClassDirective { _entities(representations: [_Any!]!): [_Entity]! } -type TestTypeClassDirective @key(fields: "id") { - id: Int! -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type TestTypeClassDirective @key(fields: "id") { + id: Int! +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = TestTypeClassDirective +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -31,9 +37,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql index 0d9a9bec1b8..4fc9ee93db3 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql @@ -9,19 +9,25 @@ type Query { _entities(representations: [_Any!]!): [_Entity]! } -type TestType @key(fields: "id") { - id: Int - name: String -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type TestType @key(fields: "id") { + id: Int + name: String +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = TestType +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -32,9 +38,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql index 20741b8ec34..dff782570a0 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql @@ -8,15 +8,21 @@ type QueryOfTestTypePropertyDirective { _service: _Service! } -type TestTypePropertyDirective @key(fields: "id", resolvable: false) { - id: Int! -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type TestTypePropertyDirective @key(fields: "id", resolvable: false) { + id: Int! +} + +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -27,9 +33,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql index 1320b1ba993..f4587185208 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql @@ -8,15 +8,21 @@ type QueryOfTestTypePropertyDirectives { _service: _Service! } +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + type TestTypePropertyDirectives @key(fields: "id name", resolvable: false) { id: Int! name: String! } -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! -} +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -28,9 +34,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql index c6d71e18450..8fa0d304004 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql @@ -3,25 +3,31 @@ schema query: QueryOfTestTypeClassDirective } -interface ITestTypeInterfaceDirective @key(fields: "id", resolvable: false) { - id: Int! -} - type QueryOfTestTypeClassDirective { someField(id: Int!): TestTypeClassDirective! _service: _Service! } +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + type TestTypeClassDirective implements ITestTypeInterfaceDirective @key(fields: "id", resolvable: false) { id: Int! } -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! +interface ITestTypeInterfaceDirective @key(fields: "id", resolvable: false) { + id: Int! } +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -32,9 +38,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql index c71d6642d64..5b54a356e89 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql @@ -3,17 +3,17 @@ schema query: Query } -interface ITestType @key(fields: "id", resolvable: false) { - id: Int - name: String -} - type Query { someField(a: Int): ITestType _service: _Service! _entities(representations: [_Any!]!): [_Entity]! } +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + type TestType implements ITestType @key(fields: "id", resolvable: false) { id: Int name: String @@ -24,14 +24,20 @@ type TestTypeResolvableKey implements ITestType @key(fields: "id") { name: String } -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! +interface ITestType @key(fields: "id", resolvable: false) { + id: Int + name: String } "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = TestTypeResolvableKey +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -42,9 +48,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql index 445c00b996b..e9d0a42d67f 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql @@ -8,15 +8,21 @@ type QueryOfTestTypeClassDirective { _service: _Service! } -type TestTypeClassDirective @key(fields: "id", resolvable: false) { - id: Int! -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type TestTypeClassDirective @key(fields: "id", resolvable: false) { + id: Int! +} + +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -27,9 +33,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql index 6960064534f..21c0399ce35 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql @@ -9,6 +9,11 @@ type Query { _entities(representations: [_Any!]!): [_Entity]! } +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + type TestType @key(fields: "id", resolvable: false) { id: Int name: String @@ -19,14 +24,15 @@ type TestTypeResolvableKey @key(fields: "id") { name: String } -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! -} - "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = TestTypeResolvableKey +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -37,9 +43,3 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Annotation.snap b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Annotation.snap index 954f3385a06..d675905f048 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Annotation.snap +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Annotation.snap @@ -3,12 +3,6 @@ schema query: Query } -type Foo @key(fields: "id") { - id: ID! - name: String! @override(from: "bar") - description: String! @override(from: "bar") -} - type Query { _service: _Service! _entities(representations: [_Any!]!): [_Entity]! @@ -19,9 +13,21 @@ type _Service { sdl: String! } +type Foo @key(fields: "id") { + id: ID! + name: String! @override(from: "bar") + description: String! @override(from: "bar") +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Foo +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -35,9 +41,3 @@ directive @link( "Overrides fields resolution logic from other subgraph. Used for migrating fields from one subgraph to another." directive @override(from: String!) on FIELD_DEFINITION - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Progressive_Annotation.snap b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Progressive_Annotation.snap index 267de041e24..36a88062f3f 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Progressive_Annotation.snap +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Progressive_Annotation.snap @@ -3,12 +3,6 @@ schema query: Query } -type Foo @key(fields: "id") { - id: ID! - name: String! @override(from: "bar") - description: String! @override(from: "bar", label: "percent(1)") -} - type Query { _service: _Service! _entities(representations: [_Any!]!): [_Entity]! @@ -19,9 +13,21 @@ type _Service { sdl: String! } +type Foo @key(fields: "id") { + id: ID! + name: String! @override(from: "bar") + description: String! @override(from: "bar", label: "percent(1)") +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Foo +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -35,9 +41,3 @@ directive @link( "Overrides fields resolution logic from other subgraph. Used for migrating fields from one subgraph to another." directive @override(from: String!, label: String) on FIELD_DEFINITION - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirective_GetsAddedCorrectly_Annotations.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirective_GetsAddedCorrectly_Annotations.graphql index 3f8a78f1165..cb9909d379e 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirective_GetsAddedCorrectly_Annotations.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirective_GetsAddedCorrectly_Annotations.graphql @@ -9,18 +9,24 @@ type Query { _entities(representations: [_Any!]!): [_Entity]! } -type Review @key(fields: "id") @policy(policies: [["p3"]]) { - id: Int! -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type Review @key(fields: "id") @policy(policies: [["p3"]]) { + id: Int! +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Review +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -37,9 +43,3 @@ directive @policy( "Retrieves list of a list of authorization policies to evaluate." policies: [[String!]!]! ) on SCALAR | OBJECT | FIELD_DEFINITION | INTERFACE | ENUM - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_Annotations.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_Annotations.graphql index 3f8a78f1165..cb9909d379e 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_Annotations.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_Annotations.graphql @@ -9,18 +9,24 @@ type Query { _entities(representations: [_Any!]!): [_Entity]! } -type Review @key(fields: "id") @policy(policies: [["p3"]]) { - id: Int! -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type Review @key(fields: "id") @policy(policies: [["p3"]]) { + id: Int! +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Review +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -37,9 +43,3 @@ directive @policy( "Retrieves list of a list of authorization policies to evaluate." policies: [[String!]!]! ) on SCALAR | OBJECT | FIELD_DEFINITION | INTERFACE | ENUM - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_CodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_CodeFirst.graphql index 7f71ac90582..8fb8ee88264 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_CodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_CodeFirst.graphql @@ -9,18 +9,24 @@ type Query { _entities(representations: [_Any!]!): [_Entity]! } -type Review @key(fields: "id") @key(fields: "id") @policy(policies: [["p3"]]) { - id: Int! -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type Review @key(fields: "id") @key(fields: "id") @policy(policies: [["p3"]]) { + id: Int! +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Review +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -37,9 +43,3 @@ directive @policy( "Retrieves list of a list of authorization policies to evaluate." policies: [[String!]!]! ) on SCALAR | OBJECT | FIELD_DEFINITION | INTERFACE | ENUM - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql index d22320ceb62..446db8a8459 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql @@ -3,29 +3,35 @@ schema query: Query } -type Product { - name: String! -} - type Query { someField(id: Int!): Review! _service: _Service! _entities(representations: [_Any!]!): [_Entity]! } -type Review @key(fields: "id") { - id: Int! - product: Product! @provides(fields: "name") -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type Product { + name: String! +} + +type Review @key(fields: "id") { + id: Int! + product: Product! @provides(fields: "name") +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Review +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -39,9 +45,3 @@ directive @link( "Used to annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the federation gateway." directive @provides(fields: FieldSet!) on FIELD_DEFINITION - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql index 692c0c69203..37a42825fc6 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql @@ -3,29 +3,35 @@ schema query: Query } -type Product { - name: String -} - type Query { someField(a: Int): Review _service: _Service! _entities(representations: [_Any!]!): [_Entity]! } -type Review @key(fields: "id") { - id: Int - product: Product @provides(fields: "name") -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type Product { + name: String +} + +type Review @key(fields: "id") { + id: Int + product: Product @provides(fields: "name") +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Review +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -39,9 +45,3 @@ directive @link( "Used to annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the federation gateway." directive @provides(fields: FieldSet!) on FIELD_DEFINITION - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql index 703f1b7ed2a..718d50b8012 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql @@ -3,29 +3,35 @@ schema query: Query } -type Product { - name: String! -} - type Query { someField(id: Int!): Review! _service: _Service! _entities(representations: [_Any!]!): [_Entity]! } -type Review @key(fields: "id") { - id: Int! - product: Product! @requires(fields: "id") -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type Product { + name: String! +} + +type Review @key(fields: "id") { + id: Int! + product: Product! @requires(fields: "id") +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Review +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -39,9 +45,3 @@ directive @link( "Used to annotate the required input fieldset from a base type for a resolver." directive @requires(fields: FieldSet!) on FIELD_DEFINITION - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql index 1a007c9883d..c12a0d8f406 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql @@ -3,29 +3,35 @@ schema query: Query } -type Product { - name: String -} - type Query { someField(a: Int): Review _service: _Service! _entities(representations: [_Any!]!): [_Entity]! } -type Review @key(fields: "id") { - id: Int - product: Product @requires(fields: "id") -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type Product { + name: String +} + +type Review @key(fields: "id") { + id: Int + product: Product @requires(fields: "id") +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Review +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -39,9 +45,3 @@ directive @link( "Used to annotate the required input fieldset from a base type for a resolver." directive @requires(fields: FieldSet!) on FIELD_DEFINITION - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirective_GetsAddedCorrectly_Annotations.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirective_GetsAddedCorrectly_Annotations.graphql index a988b60ba84..9624e5dcdac 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirective_GetsAddedCorrectly_Annotations.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirective_GetsAddedCorrectly_Annotations.graphql @@ -9,18 +9,24 @@ type Query { _entities(representations: [_Any!]!): [_Entity]! } -type Review @key(fields: "id") @requiresScopes(scopes: [["s3"]]) { - id: Int! -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type Review @key(fields: "id") @requiresScopes(scopes: [["s3"]]) { + id: Int! +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Review +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -37,9 +43,3 @@ directive @requiresScopes( "Retrieves list of a list of required JWT scopes." scopes: [[String!]!]! ) on SCALAR | OBJECT | FIELD_DEFINITION | INTERFACE | ENUM - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_Annotations.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_Annotations.graphql index a988b60ba84..9624e5dcdac 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_Annotations.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_Annotations.graphql @@ -9,18 +9,24 @@ type Query { _entities(representations: [_Any!]!): [_Entity]! } -type Review @key(fields: "id") @requiresScopes(scopes: [["s3"]]) { - id: Int! -} - "This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." type _Service { sdl: String! } +type Review @key(fields: "id") @requiresScopes(scopes: [["s3"]]) { + id: Int! +} + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Review +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -37,9 +43,3 @@ directive @requiresScopes( "Retrieves list of a list of required JWT scopes." scopes: [[String!]!]! ) on SCALAR | OBJECT | FIELD_DEFINITION | INTERFACE | ENUM - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_CodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_CodeFirst.graphql index 504689e32db..c0ff123c24d 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_CodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_CodeFirst.graphql @@ -9,6 +9,11 @@ type Query { _entities(representations: [_Any!]!): [_Entity]! } +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + type Review @key(fields: "id") @key(fields: "id") @@ -16,14 +21,15 @@ type Review id: Int! } -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! -} - "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Review +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any + +"Scalar representing a set of fields." +scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -40,9 +46,3 @@ directive @requiresScopes( "Retrieves list of a list of required JWT scopes." scopes: [[String!]!]! ) on SCALAR | OBJECT | FIELD_DEFINITION | INTERFACE | ENUM - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/ServiceTypeTests.cs b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/ServiceTypeTests.cs index f3b8267edf7..e4e48b834ce 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/ServiceTypeTests.cs +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/ServiceTypeTests.cs @@ -37,10 +37,6 @@ public async Task TestServiceTypeEmptyQueryTypePureCodeFirst() query: Query } - type Address @key(fields: "matchCode") { - matchCode: String - } - type Query { _service: _Service! _entities(representations: [_Any!]!): [_Entity]! @@ -51,9 +47,19 @@ type _Service { sdl: String! } + type Address @key(fields: "matchCode") { + matchCode: String + } + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Address + "The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." + scalar _Any + + "Scalar representing a set of fields." + scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -64,12 +70,6 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - - "Scalar representing a set of fields." - scalar FieldSet - - "The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." - scalar _Any """); } @@ -99,10 +99,6 @@ public async Task TestServiceTypeTypePureCodeFirst() query: Query } - type Address @key(fields: "matchCode") { - matchCode: String - } - type Query { address(id: Int!): Address! _service: _Service! @@ -114,9 +110,19 @@ type _Service { sdl: String! } + type Address @key(fields: "matchCode") { + matchCode: String + } + "Union of all types that key directive applied. This information is needed by the Apollo federation gateway." union _Entity = Address + "The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." + scalar _Any + + "Scalar representing a set of fields." + scalar FieldSet + "Used to indicate a combination of fields that can be used to uniquely identify and fetch an object or interface." directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE @@ -127,12 +133,6 @@ directive @link( "Gets optional list of imported element names." import: [String!] ) repeatable on SCHEMA - - "Scalar representing a set of fields." - scalar FieldSet - - "The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." - scalar _Any """); } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesShareableTests.Ensure_PagingInfo_Is_Shareable.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesShareableTests.Ensure_PagingInfo_Is_Shareable.graphql index f50f689fd5d..881e3a613b3 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesShareableTests.Ensure_PagingInfo_Is_Shareable.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesShareableTests.Ensure_PagingInfo_Is_Shareable.graphql @@ -3,6 +3,25 @@ schema query: Query } +type Query { + addresses( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AddressesConnection + _service: _Service! +} + +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + type Address { street: String! } @@ -37,24 +56,11 @@ type PageInfo { endCursor: String @shareable } -type Query { - addresses( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AddressesConnection - _service: _Service! -} +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! -} +"Scalar representing a set of fields." +scalar FieldSet "Links definitions within the document to external schemas." directive @link( @@ -66,9 +72,3 @@ directive @link( "Indicates that given object and/or field can be resolved by multiple subgraphs." directive @shareable repeatable on OBJECT | FIELD_DEFINITION - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesShareableTests.Ensure_PagingInfo_Is_Shareable_When_Shareable_Already_Registered.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesShareableTests.Ensure_PagingInfo_Is_Shareable_When_Shareable_Already_Registered.graphql index f50f689fd5d..881e3a613b3 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesShareableTests.Ensure_PagingInfo_Is_Shareable_When_Shareable_Already_Registered.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesShareableTests.Ensure_PagingInfo_Is_Shareable_When_Shareable_Already_Registered.graphql @@ -3,6 +3,25 @@ schema query: Query } +type Query { + addresses( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AddressesConnection + _service: _Service! +} + +"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." +type _Service { + sdl: String! +} + type Address { street: String! } @@ -37,24 +56,11 @@ type PageInfo { endCursor: String @shareable } -type Query { - addresses( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AddressesConnection - _service: _Service! -} +"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." +scalar _Any -"This type provides a field named sdl: String! which exposes the SDL of the service's schema. This SDL (schema definition language) is a printed version of the service's schema including the annotations of federation directives. This SDL does not include the additions of the federation spec." -type _Service { - sdl: String! -} +"Scalar representing a set of fields." +scalar FieldSet "Links definitions within the document to external schemas." directive @link( @@ -66,9 +72,3 @@ directive @link( "Indicates that given object and/or field can be resolved by multiple subgraphs." directive @shareable repeatable on OBJECT | FIELD_DEFINITION - -"Scalar representing a set of fields." -scalar FieldSet - -"The _Any scalar is used to pass representations of entities from external services into the root _entities field for execution. Validation of the _Any scalar is done by matching the __typename and @external fields defined in the schema." -scalar _Any diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Formatters/DefaultHttpResponseFormatter.cs b/src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Formatters/DefaultHttpResponseFormatter.cs index 61f2d91abe7..534b3faee93 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Formatters/DefaultHttpResponseFormatter.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Formatters/DefaultHttpResponseFormatter.cs @@ -7,6 +7,7 @@ using System.Text.Encodings.Web; using System.Text.Json; using HotChocolate.AspNetCore.Utilities; +using HotChocolate.Serialization; using HotChocolate.Transport.Formatters; using Microsoft.AspNetCore.Http; using Microsoft.Net.Http.Headers; @@ -870,7 +871,13 @@ private sealed class CachedSchemaOutput public CachedSchemaOutput(ISchemaDefinition schema, ulong version, DateTimeOffset lastModifiedTime) { - _schema = Encoding.UTF8.GetBytes(schema.ToString()); + _schema = Encoding.UTF8.GetBytes( + SchemaFormatter.FormatAsString( + schema, + new SchemaFormatterOptions + { + IncludeInternalDirectives = false + })); FileName = GetSchemaFileName(schema); ETag = CreateETag(_schema, version); LastModified = lastModifiedTime.ToString("R"); @@ -907,7 +914,12 @@ private sealed class CachedSemanticNonNullSchemaOutput public CachedSemanticNonNullSchemaOutput(ISchemaDefinition schema, ulong version, DateTimeOffset lastModifiedTime) { - var document = (HotChocolate.Language.DocumentNode)schema.ToSyntaxNode(); + var document = SchemaFormatter.FormatAsDocument( + schema, + new SchemaFormatterOptions + { + IncludeInternalDirectives = false + }); var rewritten = SemanticNonNullSchemaRewriter.Rewrite(document); _schema = Encoding.UTF8.GetBytes(rewritten.ToString(indented: true)); FileName = GetSchemaFileName(schema); diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSchemaMiddlewareTests.cs b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSchemaMiddlewareTests.cs index 6e3f5aea252..9514b9852a3 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSchemaMiddlewareTests.cs +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSchemaMiddlewareTests.cs @@ -1,19 +1,16 @@ using System.Net; using HotChocolate.AspNetCore.Tests.Utilities; using HotChocolate.Execution; +using HotChocolate.Types; using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; namespace HotChocolate.AspNetCore; -public class HttpGetSchemaMiddlewareTests : ServerTestBase +public class HttpGetSchemaMiddlewareTests(TestServerFactory serverFactory) : ServerTestBase(serverFactory) { - public HttpGetSchemaMiddlewareTests(TestServerFactory serverFactory) - : base(serverFactory) - { - } - [Fact] public async Task Download_GraphQL_SDL() { @@ -259,8 +256,53 @@ public async Task Download_GraphQL_SDL_Disabled() result.MatchSnapshot(); } + [Fact] + public async Task Download_GraphQL_Schema_Does_Not_Include_Internal_Directives() + { + // arrange + var server = ServerFactory.Create( + services => services + .AddRouting() + .AddGraphQLServer() + .AddDirectiveType() + .AddQueryType(), + app => app + .UseRouting() + .UseEndpoints(endpoints => endpoints.MapGraphQLSchema())); + var url = TestServerExtensions.CreateUrl("/graphql/sdl"); + var request = new HttpRequestMessage(HttpMethod.Get, url); + + // act + var response = await server.CreateClient().SendAsync(request); + + // assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var result = await response.Content.ReadAsStringAsync(); + result.MatchSnapshot(); + } + private sealed class StaticTimeProvider : ITimeProvider { public DateTimeOffset UtcNow { get; } = new(2021, 1, 1, 0, 0, 0, TimeSpan.Zero); } + + public class DirectiveQueryType : ObjectType + { + protected override void Configure(IObjectTypeDescriptor descriptor) + { + descriptor.Name("Query"); + descriptor.Field("secret").Type>().Resolve("secret").Directive("internal"); + descriptor.Field("public").Type>().Resolve("public"); + } + } + + public class InternalDirectiveType : DirectiveType + { + protected override void Configure(IDirectiveTypeDescriptor descriptor) + { + descriptor.Name("internal"); + descriptor.Location(DirectiveLocation.FieldDefinition); + descriptor.Internal(); + } + } } diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSemanticNonNullSchemaMiddlewareTests.cs b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSemanticNonNullSchemaMiddlewareTests.cs index 87598364708..b3d33f8257b 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSemanticNonNullSchemaMiddlewareTests.cs +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSemanticNonNullSchemaMiddlewareTests.cs @@ -1,19 +1,17 @@ using System.Net; using HotChocolate.AspNetCore.Tests.Utilities; using HotChocolate.Execution; +using HotChocolate.Types; using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; namespace HotChocolate.AspNetCore; -public class HttpGetSemanticNonNullSchemaMiddlewareTests : ServerTestBase +public class HttpGetSemanticNonNullSchemaMiddlewareTests(TestServerFactory serverFactory) + : ServerTestBase(serverFactory) { - public HttpGetSemanticNonNullSchemaMiddlewareTests(TestServerFactory serverFactory) - : base(serverFactory) - { - } - [Fact] public async Task Download_GraphQL_SemanticNonNull_Schema() { @@ -110,8 +108,53 @@ public async Task Download_GraphQL_SemanticNonNull_Schema_Explicit_Pattern() result.MatchSnapshot(); } + [Fact] + public async Task Download_GraphQL_SemanticNonNull_Schema_Does_Not_Include_Internal_Directives() + { + // arrange + var server = ServerFactory.Create( + services => services + .AddRouting() + .AddGraphQLServer() + .AddDirectiveType() + .AddQueryType(), + app => app + .UseRouting() + .UseEndpoints(endpoints => endpoints.MapGraphQLSemanticNonNullSchema())); + var url = TestServerExtensions.CreateUrl("/graphql/semantic-non-null-schema.graphql"); + var request = new HttpRequestMessage(HttpMethod.Get, url); + + // act + var response = await server.CreateClient().SendAsync(request); + + // assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var result = await response.Content.ReadAsStringAsync(); + result.MatchSnapshot(); + } + private sealed class StaticTimeProvider : ITimeProvider { public DateTimeOffset UtcNow { get; } = new(2021, 1, 1, 0, 0, 0, TimeSpan.Zero); } + + public class DirectiveQueryType : ObjectType + { + protected override void Configure(IObjectTypeDescriptor descriptor) + { + descriptor.Name("Query"); + descriptor.Field("secret").Type>().Resolve("secret").Directive("internal"); + descriptor.Field("public").Type>().Resolve("public"); + } + } + + public class InternalDirectiveType : DirectiveType + { + protected override void Configure(IDirectiveTypeDescriptor descriptor) + { + descriptor.Name("internal"); + descriptor.Location(DirectiveLocation.FieldDefinition); + descriptor.Internal(); + } + } } diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL.snap b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL.snap index 5e3ecccb04c..fbf9e68d3d1 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL.snap +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL.snap @@ -4,22 +4,31 @@ schema { subscription: Subscription } -interface Character { - id: ID! - name: String! - friends( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): FriendsConnection - appearsIn: [Episode] - traits: Any - height(unit: Unit): Float +type Query { + hero(episode: Episode! = NEW_HOPE): Character + heroByTraits(traits: Any!): Character + heroes(episodes: [Episode!]!): [Character!] + character(characterIds: [String!]!): [Character!]! @cost(weight: "10") + search(text: String!): [SearchResult] + human(id: String!): Human + droid(id: String!): Droid + time: Long! + evict: Boolean! + wait(m: Int!): Boolean! @cost(weight: "10") + someDeprecatedField( + deprecatedArg: String! = "foo" @deprecated(reason: "use something else") + ): String! @deprecated(reason: "use something else") +} + +type Mutation { + createReview(episode: Episode!, review: ReviewInput!): Review! + @cost(weight: "10") + complete(episode: Episode!): Boolean! @cost(weight: "10") +} + +type Subscription { + onReview(episode: Episode!): Review! + delay(delay: Int!, count: Int!): String! } type Droid implements Character { @@ -83,12 +92,6 @@ type Human implements Character { traits: Any } -type Mutation { - createReview(episode: Episode!, review: ReviewInput!): Review! - @cost(weight: "10") - complete(episode: Episode!): Boolean! @cost(weight: "10") -} - "Information about pagination in a connection." type PageInfo { "Indicates whether more edges exist following the set defined by the clients arguments." @@ -101,22 +104,6 @@ type PageInfo { endCursor: String } -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: Any!): Character - heroes(episodes: [Episode!]!): [Character!] - character(characterIds: [String!]!): [Character!]! @cost(weight: "10") - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid - time: Long! - evict: Boolean! - wait(m: Int!): Boolean! @cost(weight: "10") - someDeprecatedField( - deprecatedArg: String! = "foo" @deprecated(reason: "use something else") - ): String! @deprecated(reason: "use something else") -} - type Review { commentary: String @cost(weight: "10") stars: Int! @@ -128,9 +115,22 @@ type Starship { length(unit: Unit): Float! } -type Subscription { - onReview(episode: Episode!): Review! - delay(delay: Int!, count: Int!): String! +interface Character { + id: ID! + name: String! + friends( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): FriendsConnection + appearsIn: [Episode] + traits: Any + height(unit: Unit): Float } union SearchResult = Starship | Human | Droid @@ -151,6 +151,13 @@ enum Unit { METERS } +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long + @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") + "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." directive @cost( "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." @@ -181,12 +188,6 @@ directive @listSize( requireOneSlicingArgument: Boolean = true ) on FIELD_DEFINITION -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." directive @stream( "If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." @@ -196,10 +197,3 @@ directive @stream( "Streamed when true." if: Boolean ) on FIELD - -"The `Any` scalar type represents any valid GraphQL value." -scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") - -"The `Long` scalar type represents a signed 64-bit integer." -scalar Long - @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route.snap b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route.snap index 2379c02f438..14f862294ec 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route.snap +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route.snap @@ -4,22 +4,31 @@ schema { subscription: Subscription } -interface Character { - id: ID! - name: String! - friends( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): FriendsConnection - appearsIn: [Episode] - traits: Any - height(unit: Unit): Float +type Query { + hero(episode: Episode! = NEW_HOPE): Character + heroByTraits(traits: Any!): Character + heroes(episodes: [Episode!]!): [Character!] + character(characterIds: [String!]!): [Character!]! @cost(weight: "10") + search(text: String!): [SearchResult] + human(id: String!): Human + droid(id: String!): Droid + time: Long! + evict: Boolean! + wait(m: Int!): Boolean! @cost(weight: "10") + someDeprecatedField( + deprecatedArg: String! = "foo" @deprecated(reason: "use something else") + ): String! @deprecated(reason: "use something else") +} + +type Mutation { + createReview(episode: Episode!, review: ReviewInput!): Review! + @cost(weight: "10") + complete(episode: Episode!): Boolean! @cost(weight: "10") +} + +type Subscription { + onReview(episode: Episode!): Review! + delay(delay: Int!, count: Int!): String! } type Droid implements Character { @@ -83,12 +92,6 @@ type Human implements Character { traits: Any } -type Mutation { - createReview(episode: Episode!, review: ReviewInput!): Review! - @cost(weight: "10") - complete(episode: Episode!): Boolean! @cost(weight: "10") -} - "Information about pagination in a connection." type PageInfo { "Indicates whether more edges exist following the set defined by the clients arguments." @@ -101,22 +104,6 @@ type PageInfo { endCursor: String } -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: Any!): Character - heroes(episodes: [Episode!]!): [Character!] - character(characterIds: [String!]!): [Character!]! @cost(weight: "10") - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid - time: Long! - evict: Boolean! - wait(m: Int!): Boolean! @cost(weight: "10") - someDeprecatedField( - deprecatedArg: String! = "foo" @deprecated(reason: "use something else") - ): String! @deprecated(reason: "use something else") -} - type Review { commentary: String @cost(weight: "10") stars: Int! @@ -128,9 +115,22 @@ type Starship { length(unit: Unit): Float! } -type Subscription { - onReview(episode: Episode!): Review! - delay(delay: Int!, count: Int!): String! +interface Character { + id: ID! + name: String! + friends( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): FriendsConnection + appearsIn: [Episode] + traits: Any + height(unit: Unit): Float } union SearchResult = Starship | Human | Droid @@ -151,6 +151,13 @@ enum Unit { METERS } +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long + @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") + "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." directive @cost( "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." @@ -179,12 +186,6 @@ directive @listSize( requireOneSlicingArgument: Boolean = true ) on FIELD_DEFINITION -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." directive @stream( "If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." @@ -194,10 +195,3 @@ directive @stream( "Streamed when true." if: Boolean ) on FIELD - -"The `Any` scalar type represents any valid GraphQL value." -scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") - -"The `Long` scalar type represents a signed 64-bit integer." -scalar Long - @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_Explicit_Pattern.snap b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_Explicit_Pattern.snap index 2379c02f438..14f862294ec 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_Explicit_Pattern.snap +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_SDL_Explicit_Route_Explicit_Pattern.snap @@ -4,22 +4,31 @@ schema { subscription: Subscription } -interface Character { - id: ID! - name: String! - friends( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): FriendsConnection - appearsIn: [Episode] - traits: Any - height(unit: Unit): Float +type Query { + hero(episode: Episode! = NEW_HOPE): Character + heroByTraits(traits: Any!): Character + heroes(episodes: [Episode!]!): [Character!] + character(characterIds: [String!]!): [Character!]! @cost(weight: "10") + search(text: String!): [SearchResult] + human(id: String!): Human + droid(id: String!): Droid + time: Long! + evict: Boolean! + wait(m: Int!): Boolean! @cost(weight: "10") + someDeprecatedField( + deprecatedArg: String! = "foo" @deprecated(reason: "use something else") + ): String! @deprecated(reason: "use something else") +} + +type Mutation { + createReview(episode: Episode!, review: ReviewInput!): Review! + @cost(weight: "10") + complete(episode: Episode!): Boolean! @cost(weight: "10") +} + +type Subscription { + onReview(episode: Episode!): Review! + delay(delay: Int!, count: Int!): String! } type Droid implements Character { @@ -83,12 +92,6 @@ type Human implements Character { traits: Any } -type Mutation { - createReview(episode: Episode!, review: ReviewInput!): Review! - @cost(weight: "10") - complete(episode: Episode!): Boolean! @cost(weight: "10") -} - "Information about pagination in a connection." type PageInfo { "Indicates whether more edges exist following the set defined by the clients arguments." @@ -101,22 +104,6 @@ type PageInfo { endCursor: String } -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: Any!): Character - heroes(episodes: [Episode!]!): [Character!] - character(characterIds: [String!]!): [Character!]! @cost(weight: "10") - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid - time: Long! - evict: Boolean! - wait(m: Int!): Boolean! @cost(weight: "10") - someDeprecatedField( - deprecatedArg: String! = "foo" @deprecated(reason: "use something else") - ): String! @deprecated(reason: "use something else") -} - type Review { commentary: String @cost(weight: "10") stars: Int! @@ -128,9 +115,22 @@ type Starship { length(unit: Unit): Float! } -type Subscription { - onReview(episode: Episode!): Review! - delay(delay: Int!, count: Int!): String! +interface Character { + id: ID! + name: String! + friends( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): FriendsConnection + appearsIn: [Episode] + traits: Any + height(unit: Unit): Float } union SearchResult = Starship | Human | Droid @@ -151,6 +151,13 @@ enum Unit { METERS } +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long + @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") + "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." directive @cost( "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." @@ -179,12 +186,6 @@ directive @listSize( requireOneSlicingArgument: Boolean = true ) on FIELD_DEFINITION -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." directive @stream( "If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." @@ -194,10 +195,3 @@ directive @stream( "Streamed when true." if: Boolean ) on FIELD - -"The `Any` scalar type represents any valid GraphQL value." -scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") - -"The `Long` scalar type represents a signed 64-bit integer." -scalar Long - @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema.md b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema.md index 7de9c4ac83b..6b3e497053c 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema.md +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema.md @@ -15,22 +15,31 @@ schema { subscription: Subscription } -interface Character { - id: ID! - name: String! - friends( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): FriendsConnection - appearsIn: [Episode] - traits: Any - height(unit: Unit): Float +type Query { + hero(episode: Episode! = NEW_HOPE): Character + heroByTraits(traits: Any!): Character + heroes(episodes: [Episode!]!): [Character!] + character(characterIds: [String!]!): [Character!]! @cost(weight: "10") + search(text: String!): [SearchResult] + human(id: String!): Human + droid(id: String!): Droid + time: Long! + evict: Boolean! + wait(m: Int!): Boolean! @cost(weight: "10") + someDeprecatedField( + deprecatedArg: String! = "foo" @deprecated(reason: "use something else") + ): String! @deprecated(reason: "use something else") +} + +type Mutation { + createReview(episode: Episode!, review: ReviewInput!): Review! + @cost(weight: "10") + complete(episode: Episode!): Boolean! @cost(weight: "10") +} + +type Subscription { + onReview(episode: Episode!): Review! + delay(delay: Int!, count: Int!): String! } type Droid implements Character { @@ -94,12 +103,6 @@ type Human implements Character { traits: Any } -type Mutation { - createReview(episode: Episode!, review: ReviewInput!): Review! - @cost(weight: "10") - complete(episode: Episode!): Boolean! @cost(weight: "10") -} - "Information about pagination in a connection." type PageInfo { "Indicates whether more edges exist following the set defined by the clients arguments." @@ -112,22 +115,6 @@ type PageInfo { endCursor: String } -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: Any!): Character - heroes(episodes: [Episode!]!): [Character!] - character(characterIds: [String!]!): [Character!]! @cost(weight: "10") - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid - time: Long! - evict: Boolean! - wait(m: Int!): Boolean! @cost(weight: "10") - someDeprecatedField( - deprecatedArg: String! = "foo" @deprecated(reason: "use something else") - ): String! @deprecated(reason: "use something else") -} - type Review { commentary: String @cost(weight: "10") stars: Int! @@ -139,9 +126,22 @@ type Starship { length(unit: Unit): Float! } -type Subscription { - onReview(episode: Episode!): Review! - delay(delay: Int!, count: Int!): String! +interface Character { + id: ID! + name: String! + friends( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): FriendsConnection + appearsIn: [Episode] + traits: Any + height(unit: Unit): Float } union SearchResult = Starship | Human | Droid @@ -162,6 +162,13 @@ enum Unit { METERS } +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long + @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") + "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." directive @cost( "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." @@ -192,12 +199,6 @@ directive @listSize( requireOneSlicingArgument: Boolean = true ) on FIELD_DEFINITION -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." directive @stream( "If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." @@ -207,11 +208,4 @@ directive @stream( "Streamed when true." if: Boolean ) on FIELD - -"The `Any` scalar type represents any valid GraphQL value." -scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") - -"The `Long` scalar type represents a signed 64-bit integer." -scalar Long - @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") ``` diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_Does_Not_Include_Internal_Directives.snap b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_Does_Not_Include_Internal_Directives.snap new file mode 100644 index 00000000000..948557e848e --- /dev/null +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_Does_Not_Include_Internal_Directives.snap @@ -0,0 +1,14 @@ +schema { + query: Query +} + +type Query { + secret: String! @cost(weight: "10") + public: String! @cost(weight: "10") +} + +"The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." +directive @cost( + "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." + weight: String! +) on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | ENUM | INPUT_FIELD_DEFINITION diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_Slicing_Args_Enabled.md b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_Slicing_Args_Enabled.md index 07a45619eff..15fc5042bfb 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_Slicing_Args_Enabled.md +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSchemaMiddlewareTests.Download_GraphQL_Schema_Slicing_Args_Enabled.md @@ -15,22 +15,31 @@ schema { subscription: Subscription } -interface Character { - id: ID! - name: String! - friends( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): FriendsConnection - appearsIn: [Episode] - traits: Any - height(unit: Unit): Float +type Query { + hero(episode: Episode! = NEW_HOPE): Character + heroByTraits(traits: Any!): Character + heroes(episodes: [Episode!]!): [Character!] + character(characterIds: [String!]!): [Character!]! @cost(weight: "10") + search(text: String!): [SearchResult] + human(id: String!): Human + droid(id: String!): Droid + time: Long! + evict: Boolean! + wait(m: Int!): Boolean! @cost(weight: "10") + someDeprecatedField( + deprecatedArg: String! = "foo" @deprecated(reason: "use something else") + ): String! @deprecated(reason: "use something else") +} + +type Mutation { + createReview(episode: Episode!, review: ReviewInput!): Review! + @cost(weight: "10") + complete(episode: Episode!): Boolean! @cost(weight: "10") +} + +type Subscription { + onReview(episode: Episode!): Review! + delay(delay: Int!, count: Int!): String! } type Droid implements Character { @@ -94,12 +103,6 @@ type Human implements Character { traits: Any } -type Mutation { - createReview(episode: Episode!, review: ReviewInput!): Review! - @cost(weight: "10") - complete(episode: Episode!): Boolean! @cost(weight: "10") -} - "Information about pagination in a connection." type PageInfo { "Indicates whether more edges exist following the set defined by the clients arguments." @@ -112,22 +115,6 @@ type PageInfo { endCursor: String } -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: Any!): Character - heroes(episodes: [Episode!]!): [Character!] - character(characterIds: [String!]!): [Character!]! @cost(weight: "10") - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid - time: Long! - evict: Boolean! - wait(m: Int!): Boolean! @cost(weight: "10") - someDeprecatedField( - deprecatedArg: String! = "foo" @deprecated(reason: "use something else") - ): String! @deprecated(reason: "use something else") -} - type Review { commentary: String @cost(weight: "10") stars: Int! @@ -139,9 +126,22 @@ type Starship { length(unit: Unit): Float! } -type Subscription { - onReview(episode: Episode!): Review! - delay(delay: Int!, count: Int!): String! +interface Character { + id: ID! + name: String! + friends( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): FriendsConnection + appearsIn: [Episode] + traits: Any + height(unit: Unit): Float } union SearchResult = Starship | Human | Droid @@ -162,6 +162,13 @@ enum Unit { METERS } +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long + @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") + "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." directive @cost( "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." @@ -192,12 +199,6 @@ directive @listSize( requireOneSlicingArgument: Boolean = true ) on FIELD_DEFINITION -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." directive @stream( "If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." @@ -207,11 +208,4 @@ directive @stream( "Streamed when true." if: Boolean ) on FIELD - -"The `Any` scalar type represents any valid GraphQL value." -scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") - -"The `Long` scalar type represents a signed 64-bit integer." -scalar Long - @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") ``` diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSemanticNonNullSchemaMiddlewareTests.Download_GraphQL_SemanticNonNull_Schema.md b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSemanticNonNullSchemaMiddlewareTests.Download_GraphQL_SemanticNonNull_Schema.md index 244a577dbf7..7d0c3ca3c4c 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSemanticNonNullSchemaMiddlewareTests.Download_GraphQL_SemanticNonNull_Schema.md +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSemanticNonNullSchemaMiddlewareTests.Download_GraphQL_SemanticNonNull_Schema.md @@ -15,22 +15,33 @@ schema { subscription: Subscription } -interface Character { - id: ID! - name: String @semanticNonNull - friends( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): FriendsConnection - appearsIn: [Episode] - traits: Any - height(unit: Unit): Float +type Query { + hero(episode: Episode! = NEW_HOPE): Character + heroByTraits(traits: Any!): Character + heroes(episodes: [Episode!]!): [Character] @semanticNonNull(levels: [1]) + character(characterIds: [String!]!): [Character] + @cost(weight: "10") + @semanticNonNull(levels: [0, 1]) + search(text: String!): [SearchResult] + human(id: String!): Human + droid(id: String!): Droid + time: Long @semanticNonNull + evict: Boolean @semanticNonNull + wait(m: Int!): Boolean @cost(weight: "10") @semanticNonNull + someDeprecatedField( + deprecatedArg: String! = "foo" @deprecated(reason: "use something else") + ): String @deprecated(reason: "use something else") @semanticNonNull +} + +type Mutation { + createReview(episode: Episode!, review: ReviewInput!): Review! + @cost(weight: "10") + complete(episode: Episode!): Boolean! @cost(weight: "10") +} + +type Subscription { + onReview(episode: Episode!): Review @semanticNonNull + delay(delay: Int!, count: Int!): String @semanticNonNull } type Droid implements Character { @@ -94,12 +105,6 @@ type Human implements Character { traits: Any } -type Mutation { - createReview(episode: Episode!, review: ReviewInput!): Review! - @cost(weight: "10") - complete(episode: Episode!): Boolean! @cost(weight: "10") -} - "Information about pagination in a connection." type PageInfo { "Indicates whether more edges exist following the set defined by the clients arguments." @@ -112,24 +117,6 @@ type PageInfo { endCursor: String } -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: Any!): Character - heroes(episodes: [Episode!]!): [Character] @semanticNonNull(levels: [1]) - character(characterIds: [String!]!): [Character] - @cost(weight: "10") - @semanticNonNull(levels: [0, 1]) - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid - time: Long @semanticNonNull - evict: Boolean @semanticNonNull - wait(m: Int!): Boolean @cost(weight: "10") @semanticNonNull - someDeprecatedField( - deprecatedArg: String! = "foo" @deprecated(reason: "use something else") - ): String @deprecated(reason: "use something else") @semanticNonNull -} - type Review { commentary: String @cost(weight: "10") stars: Int @semanticNonNull @@ -141,9 +128,22 @@ type Starship { length(unit: Unit): Float @semanticNonNull } -type Subscription { - onReview(episode: Episode!): Review @semanticNonNull - delay(delay: Int!, count: Int!): String @semanticNonNull +interface Character { + id: ID! + name: String @semanticNonNull + friends( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): FriendsConnection + appearsIn: [Episode] + traits: Any + height(unit: Unit): Float } union SearchResult = Starship | Human | Droid @@ -164,6 +164,13 @@ enum Unit { METERS } +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long + @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") + "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." directive @cost( "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." @@ -198,12 +205,6 @@ directive @semanticNonNull(levels: [Int!] = [ 0 ]) on FIELD_DEFINITION -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." directive @stream( "If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." @@ -213,11 +214,4 @@ directive @stream( "Streamed when true." if: Boolean ) on FIELD - -"The `Any` scalar type represents any valid GraphQL value." -scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") - -"The `Long` scalar type represents a signed 64-bit integer." -scalar Long - @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") ``` diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSemanticNonNullSchemaMiddlewareTests.Download_GraphQL_SemanticNonNull_Schema_Does_Not_Include_Internal_Directives.snap b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSemanticNonNullSchemaMiddlewareTests.Download_GraphQL_SemanticNonNull_Schema_Does_Not_Include_Internal_Directives.snap new file mode 100644 index 00000000000..37d687096ba --- /dev/null +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSemanticNonNullSchemaMiddlewareTests.Download_GraphQL_SemanticNonNull_Schema_Does_Not_Include_Internal_Directives.snap @@ -0,0 +1,18 @@ +schema { + query: Query +} + +type Query { + secret: String @cost(weight: "10") @semanticNonNull + public: String @cost(weight: "10") @semanticNonNull +} + +"The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." +directive @cost( + "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." + weight: String! +) on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | ENUM | INPUT_FIELD_DEFINITION + +directive @semanticNonNull(levels: [Int!] = [ + 0 +]) on FIELD_DEFINITION diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSemanticNonNullSchemaMiddlewareTests.Download_GraphQL_SemanticNonNull_Schema_Explicit_Pattern.snap b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSemanticNonNullSchemaMiddlewareTests.Download_GraphQL_SemanticNonNull_Schema_Explicit_Pattern.snap index 1dfffa496a2..7a67122756a 100644 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSemanticNonNullSchemaMiddlewareTests.Download_GraphQL_SemanticNonNull_Schema_Explicit_Pattern.snap +++ b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/__snapshots__/HttpGetSemanticNonNullSchemaMiddlewareTests.Download_GraphQL_SemanticNonNull_Schema_Explicit_Pattern.snap @@ -4,22 +4,33 @@ schema { subscription: Subscription } -interface Character { - id: ID! - name: String @semanticNonNull - friends( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): FriendsConnection - appearsIn: [Episode] - traits: Any - height(unit: Unit): Float +type Query { + hero(episode: Episode! = NEW_HOPE): Character + heroByTraits(traits: Any!): Character + heroes(episodes: [Episode!]!): [Character] @semanticNonNull(levels: [1]) + character(characterIds: [String!]!): [Character] + @cost(weight: "10") + @semanticNonNull(levels: [0, 1]) + search(text: String!): [SearchResult] + human(id: String!): Human + droid(id: String!): Droid + time: Long @semanticNonNull + evict: Boolean @semanticNonNull + wait(m: Int!): Boolean @cost(weight: "10") @semanticNonNull + someDeprecatedField( + deprecatedArg: String! = "foo" @deprecated(reason: "use something else") + ): String @deprecated(reason: "use something else") @semanticNonNull +} + +type Mutation { + createReview(episode: Episode!, review: ReviewInput!): Review! + @cost(weight: "10") + complete(episode: Episode!): Boolean! @cost(weight: "10") +} + +type Subscription { + onReview(episode: Episode!): Review @semanticNonNull + delay(delay: Int!, count: Int!): String @semanticNonNull } type Droid implements Character { @@ -83,12 +94,6 @@ type Human implements Character { traits: Any } -type Mutation { - createReview(episode: Episode!, review: ReviewInput!): Review! - @cost(weight: "10") - complete(episode: Episode!): Boolean! @cost(weight: "10") -} - "Information about pagination in a connection." type PageInfo { "Indicates whether more edges exist following the set defined by the clients arguments." @@ -101,24 +106,6 @@ type PageInfo { endCursor: String } -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: Any!): Character - heroes(episodes: [Episode!]!): [Character] @semanticNonNull(levels: [1]) - character(characterIds: [String!]!): [Character] - @cost(weight: "10") - @semanticNonNull(levels: [0, 1]) - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid - time: Long @semanticNonNull - evict: Boolean @semanticNonNull - wait(m: Int!): Boolean @cost(weight: "10") @semanticNonNull - someDeprecatedField( - deprecatedArg: String! = "foo" @deprecated(reason: "use something else") - ): String @deprecated(reason: "use something else") @semanticNonNull -} - type Review { commentary: String @cost(weight: "10") stars: Int @semanticNonNull @@ -130,9 +117,22 @@ type Starship { length(unit: Unit): Float @semanticNonNull } -type Subscription { - onReview(episode: Episode!): Review @semanticNonNull - delay(delay: Int!, count: Int!): String @semanticNonNull +interface Character { + id: ID! + name: String @semanticNonNull + friends( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): FriendsConnection + appearsIn: [Episode] + traits: Any + height(unit: Unit): Float } union SearchResult = Starship | Human | Droid @@ -153,6 +153,13 @@ enum Unit { METERS } +"The `Any` scalar type represents any valid GraphQL value." +scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + +"The `Long` scalar type represents a signed 64-bit integer." +scalar Long + @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") + "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." directive @cost( "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." @@ -185,12 +192,6 @@ directive @semanticNonNull(levels: [Int!] = [ 0 ]) on FIELD_DEFINITION -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`." directive @stream( "If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." @@ -200,10 +201,3 @@ directive @stream( "Streamed when true." if: Boolean ) on FIELD - -"The `Any` scalar type represents any valid GraphQL value." -scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") - -"The `Long` scalar type represents a signed 64-bit integer." -scalar Long - @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") diff --git a/src/HotChocolate/Caching/test/Caching.Tests/SchemaTests.cs b/src/HotChocolate/Caching/test/Caching.Tests/SchemaTests.cs index 8db48737634..17bfefe9f8a 100644 --- a/src/HotChocolate/Caching/test/Caching.Tests/SchemaTests.cs +++ b/src/HotChocolate/Caching/test/Caching.Tests/SchemaTests.cs @@ -28,15 +28,15 @@ public async Task Allow_CacheControl_On_FieldDefinition() query: Query } + type Query { + book: Book! @cacheControl(maxAge: 0) + } + type Book { title: String! @cacheControl(maxAge: 5000) description: String! } - type Query { - book: Book! @cacheControl(maxAge: 0) - } - "The scope of a cache hint." enum CacheControlScope { "The value to cache is not tied to a single user." @@ -59,9 +59,6 @@ directive @cacheControl( vary: [String] ) on OBJECT | FIELD_DEFINITION | INTERFACE | UNION - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT - """ The @tag directive is used to apply arbitrary string metadata to a schema location. Custom tooling can use diff --git a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults.snap b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults.snap index 5a7fce9fd0e..4b081c91e29 100644 --- a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults.snap +++ b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults.snap @@ -2,15 +2,7 @@ schema { query: Query } -"Information about the offset pagination." -type CollectionSegmentInfo { - "Indicates whether more items exist following the set defined by the clients arguments." - hasNextPage: Boolean! - "Indicates whether more items exist prior the set defined by the clients arguments." - hasPreviousPage: Boolean! -} - -type NestedType { +type Query { taskField: String! @cacheControl(maxAge: 0) valueTaskField: String! @cacheControl(maxAge: 0) executableField: [String!]! @cacheControl(maxAge: 0) @@ -50,27 +42,21 @@ type NestedType { @cacheControl(maxAge: 200) queryableFieldWithCollectionSegmentWithCacheControl(skip: Int, take: Int): QueryableFieldWithCollectionSegmentWithCacheControlCollectionSegment @cacheControl(maxAge: 200) - pureField: String! + nested: NestedType! @cacheControl(maxAge: 0) + nested2: NestedType2! @cacheControl(maxAge: 0) + pureField: String! @cacheControl(maxAge: 0) pureFieldWithCacheControl: String! @cacheControl(maxAge: 200) } -type NestedType2 { - taskFieldWithInheritMaxAge: String! @cacheControl(inheritMaxAge: true) -} - -"Information about pagination in a connection." -type PageInfo { - "Indicates whether more edges exist following the set defined by the clients arguments." +"Information about the offset pagination." +type CollectionSegmentInfo { + "Indicates whether more items exist following the set defined by the clients arguments." hasNextPage: Boolean! - "Indicates whether more edges exist prior the set defined by the clients arguments." + "Indicates whether more items exist prior the set defined by the clients arguments." hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String - "When paginating forwards, the cursor to continue." - endCursor: String } -type Query { +type NestedType { taskField: String! @cacheControl(maxAge: 0) valueTaskField: String! @cacheControl(maxAge: 0) executableField: [String!]! @cacheControl(maxAge: 0) @@ -110,12 +96,26 @@ type Query { @cacheControl(maxAge: 200) queryableFieldWithCollectionSegmentWithCacheControl(skip: Int, take: Int): QueryableFieldWithCollectionSegmentWithCacheControlCollectionSegment @cacheControl(maxAge: 200) - nested: NestedType! @cacheControl(maxAge: 0) - nested2: NestedType2! @cacheControl(maxAge: 0) - pureField: String! @cacheControl(maxAge: 0) + pureField: String! pureFieldWithCacheControl: String! @cacheControl(maxAge: 200) } +type NestedType2 { + taskFieldWithInheritMaxAge: String! @cacheControl(inheritMaxAge: true) +} + +"Information about pagination in a connection." +type PageInfo { + "Indicates whether more edges exist following the set defined by the clients arguments." + hasNextPage: Boolean! + "Indicates whether more edges exist prior the set defined by the clients arguments." + hasPreviousPage: Boolean! + "When paginating backwards, the cursor to continue." + startCursor: String + "When paginating forwards, the cursor to continue." + endCursor: String +} + "A segment of a collection." type QueryableFieldWithCollectionSegmentCollectionSegment { "Information to aid in pagination." diff --git a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults_DifferentDefaultMaxAge.snap b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults_DifferentDefaultMaxAge.snap index a4921ac3bbb..c731765b0db 100644 --- a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults_DifferentDefaultMaxAge.snap +++ b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults_DifferentDefaultMaxAge.snap @@ -2,15 +2,7 @@ schema { query: Query } -"Information about the offset pagination." -type CollectionSegmentInfo { - "Indicates whether more items exist following the set defined by the clients arguments." - hasNextPage: Boolean! - "Indicates whether more items exist prior the set defined by the clients arguments." - hasPreviousPage: Boolean! -} - -type NestedType { +type Query { taskField: String! @cacheControl(maxAge: 100) valueTaskField: String! @cacheControl(maxAge: 100) executableField: [String!]! @cacheControl(maxAge: 100) @@ -50,27 +42,21 @@ type NestedType { @cacheControl(maxAge: 200) queryableFieldWithCollectionSegmentWithCacheControl(skip: Int, take: Int): QueryableFieldWithCollectionSegmentWithCacheControlCollectionSegment @cacheControl(maxAge: 200) - pureField: String! + nested: NestedType! @cacheControl(maxAge: 100) + nested2: NestedType2! @cacheControl(maxAge: 100) + pureField: String! @cacheControl(maxAge: 100) pureFieldWithCacheControl: String! @cacheControl(maxAge: 200) } -type NestedType2 { - taskFieldWithInheritMaxAge: String! @cacheControl(inheritMaxAge: true) -} - -"Information about pagination in a connection." -type PageInfo { - "Indicates whether more edges exist following the set defined by the clients arguments." +"Information about the offset pagination." +type CollectionSegmentInfo { + "Indicates whether more items exist following the set defined by the clients arguments." hasNextPage: Boolean! - "Indicates whether more edges exist prior the set defined by the clients arguments." + "Indicates whether more items exist prior the set defined by the clients arguments." hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String - "When paginating forwards, the cursor to continue." - endCursor: String } -type Query { +type NestedType { taskField: String! @cacheControl(maxAge: 100) valueTaskField: String! @cacheControl(maxAge: 100) executableField: [String!]! @cacheControl(maxAge: 100) @@ -110,12 +96,26 @@ type Query { @cacheControl(maxAge: 200) queryableFieldWithCollectionSegmentWithCacheControl(skip: Int, take: Int): QueryableFieldWithCollectionSegmentWithCacheControlCollectionSegment @cacheControl(maxAge: 200) - nested: NestedType! @cacheControl(maxAge: 100) - nested2: NestedType2! @cacheControl(maxAge: 100) - pureField: String! @cacheControl(maxAge: 100) + pureField: String! pureFieldWithCacheControl: String! @cacheControl(maxAge: 200) } +type NestedType2 { + taskFieldWithInheritMaxAge: String! @cacheControl(inheritMaxAge: true) +} + +"Information about pagination in a connection." +type PageInfo { + "Indicates whether more edges exist following the set defined by the clients arguments." + hasNextPage: Boolean! + "Indicates whether more edges exist prior the set defined by the clients arguments." + hasPreviousPage: Boolean! + "When paginating backwards, the cursor to continue." + startCursor: String + "When paginating forwards, the cursor to continue." + endCursor: String +} + "A segment of a collection." type QueryableFieldWithCollectionSegmentCollectionSegment { "Information to aid in pagination." diff --git a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults_DifferentDefaultScope.snap b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults_DifferentDefaultScope.snap index 1554c1546eb..a1e3e62646d 100644 --- a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults_DifferentDefaultScope.snap +++ b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults_DifferentDefaultScope.snap @@ -2,15 +2,7 @@ schema { query: Query } -"Information about the offset pagination." -type CollectionSegmentInfo { - "Indicates whether more items exist following the set defined by the clients arguments." - hasNextPage: Boolean! - "Indicates whether more items exist prior the set defined by the clients arguments." - hasPreviousPage: Boolean! -} - -type NestedType { +type Query { taskField: String! @cacheControl(maxAge: 0, scope: PRIVATE) valueTaskField: String! @cacheControl(maxAge: 0, scope: PRIVATE) executableField: [String!]! @cacheControl(maxAge: 0, scope: PRIVATE) @@ -51,27 +43,21 @@ type NestedType { @cacheControl(maxAge: 200) queryableFieldWithCollectionSegmentWithCacheControl(skip: Int, take: Int): QueryableFieldWithCollectionSegmentWithCacheControlCollectionSegment @cacheControl(maxAge: 200) - pureField: String! + nested: NestedType! @cacheControl(maxAge: 0, scope: PRIVATE) + nested2: NestedType2! @cacheControl(maxAge: 0, scope: PRIVATE) + pureField: String! @cacheControl(maxAge: 0, scope: PRIVATE) pureFieldWithCacheControl: String! @cacheControl(maxAge: 200) } -type NestedType2 { - taskFieldWithInheritMaxAge: String! @cacheControl(inheritMaxAge: true) -} - -"Information about pagination in a connection." -type PageInfo { - "Indicates whether more edges exist following the set defined by the clients arguments." +"Information about the offset pagination." +type CollectionSegmentInfo { + "Indicates whether more items exist following the set defined by the clients arguments." hasNextPage: Boolean! - "Indicates whether more edges exist prior the set defined by the clients arguments." + "Indicates whether more items exist prior the set defined by the clients arguments." hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String - "When paginating forwards, the cursor to continue." - endCursor: String } -type Query { +type NestedType { taskField: String! @cacheControl(maxAge: 0, scope: PRIVATE) valueTaskField: String! @cacheControl(maxAge: 0, scope: PRIVATE) executableField: [String!]! @cacheControl(maxAge: 0, scope: PRIVATE) @@ -112,12 +98,26 @@ type Query { @cacheControl(maxAge: 200) queryableFieldWithCollectionSegmentWithCacheControl(skip: Int, take: Int): QueryableFieldWithCollectionSegmentWithCacheControlCollectionSegment @cacheControl(maxAge: 200) - nested: NestedType! @cacheControl(maxAge: 0, scope: PRIVATE) - nested2: NestedType2! @cacheControl(maxAge: 0, scope: PRIVATE) - pureField: String! @cacheControl(maxAge: 0, scope: PRIVATE) + pureField: String! pureFieldWithCacheControl: String! @cacheControl(maxAge: 200) } +type NestedType2 { + taskFieldWithInheritMaxAge: String! @cacheControl(inheritMaxAge: true) +} + +"Information about pagination in a connection." +type PageInfo { + "Indicates whether more edges exist following the set defined by the clients arguments." + hasNextPage: Boolean! + "Indicates whether more edges exist prior the set defined by the clients arguments." + hasPreviousPage: Boolean! + "When paginating backwards, the cursor to continue." + startCursor: String + "When paginating forwards, the cursor to continue." + endCursor: String +} + "A segment of a collection." type QueryableFieldWithCollectionSegmentCollectionSegment { "Information to aid in pagination." diff --git a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults_False.snap b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults_False.snap index 9f6627f4f06..41b75de68ce 100644 --- a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults_False.snap +++ b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_ApplyDefaults_False.snap @@ -2,15 +2,7 @@ schema { query: Query } -"Information about the offset pagination." -type CollectionSegmentInfo { - "Indicates whether more items exist following the set defined by the clients arguments." - hasNextPage: Boolean! - "Indicates whether more items exist prior the set defined by the clients arguments." - hasPreviousPage: Boolean! -} - -type NestedType { +type Query { taskField: String! valueTaskField: String! executableField: [String!]! @@ -49,27 +41,21 @@ type NestedType { @cacheControl(maxAge: 200) queryableFieldWithCollectionSegmentWithCacheControl(skip: Int, take: Int): QueryableFieldWithCollectionSegmentWithCacheControlCollectionSegment @cacheControl(maxAge: 200) + nested: NestedType! + nested2: NestedType2! pureField: String! pureFieldWithCacheControl: String! @cacheControl(maxAge: 200) } -type NestedType2 { - taskFieldWithInheritMaxAge: String! @cacheControl(inheritMaxAge: true) -} - -"Information about pagination in a connection." -type PageInfo { - "Indicates whether more edges exist following the set defined by the clients arguments." +"Information about the offset pagination." +type CollectionSegmentInfo { + "Indicates whether more items exist following the set defined by the clients arguments." hasNextPage: Boolean! - "Indicates whether more edges exist prior the set defined by the clients arguments." + "Indicates whether more items exist prior the set defined by the clients arguments." hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String - "When paginating forwards, the cursor to continue." - endCursor: String } -type Query { +type NestedType { taskField: String! valueTaskField: String! executableField: [String!]! @@ -108,12 +94,26 @@ type Query { @cacheControl(maxAge: 200) queryableFieldWithCollectionSegmentWithCacheControl(skip: Int, take: Int): QueryableFieldWithCollectionSegmentWithCacheControlCollectionSegment @cacheControl(maxAge: 200) - nested: NestedType! - nested2: NestedType2! pureField: String! pureFieldWithCacheControl: String! @cacheControl(maxAge: 200) } +type NestedType2 { + taskFieldWithInheritMaxAge: String! @cacheControl(inheritMaxAge: true) +} + +"Information about pagination in a connection." +type PageInfo { + "Indicates whether more edges exist following the set defined by the clients arguments." + hasNextPage: Boolean! + "Indicates whether more edges exist prior the set defined by the clients arguments." + hasPreviousPage: Boolean! + "When paginating backwards, the cursor to continue." + startCursor: String + "When paginating forwards, the cursor to continue." + endCursor: String +} + "A segment of a collection." type QueryableFieldWithCollectionSegmentCollectionSegment { "Information to aid in pagination." diff --git a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_CacheControl_Disabled.snap b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_CacheControl_Disabled.snap index 9f6627f4f06..41b75de68ce 100644 --- a/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_CacheControl_Disabled.snap +++ b/src/HotChocolate/Caching/test/Caching.Tests/__snapshots__/CacheControlTypeInterceptorTests.DataResolvers_CacheControl_Disabled.snap @@ -2,15 +2,7 @@ schema { query: Query } -"Information about the offset pagination." -type CollectionSegmentInfo { - "Indicates whether more items exist following the set defined by the clients arguments." - hasNextPage: Boolean! - "Indicates whether more items exist prior the set defined by the clients arguments." - hasPreviousPage: Boolean! -} - -type NestedType { +type Query { taskField: String! valueTaskField: String! executableField: [String!]! @@ -49,27 +41,21 @@ type NestedType { @cacheControl(maxAge: 200) queryableFieldWithCollectionSegmentWithCacheControl(skip: Int, take: Int): QueryableFieldWithCollectionSegmentWithCacheControlCollectionSegment @cacheControl(maxAge: 200) + nested: NestedType! + nested2: NestedType2! pureField: String! pureFieldWithCacheControl: String! @cacheControl(maxAge: 200) } -type NestedType2 { - taskFieldWithInheritMaxAge: String! @cacheControl(inheritMaxAge: true) -} - -"Information about pagination in a connection." -type PageInfo { - "Indicates whether more edges exist following the set defined by the clients arguments." +"Information about the offset pagination." +type CollectionSegmentInfo { + "Indicates whether more items exist following the set defined by the clients arguments." hasNextPage: Boolean! - "Indicates whether more edges exist prior the set defined by the clients arguments." + "Indicates whether more items exist prior the set defined by the clients arguments." hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String - "When paginating forwards, the cursor to continue." - endCursor: String } -type Query { +type NestedType { taskField: String! valueTaskField: String! executableField: [String!]! @@ -108,12 +94,26 @@ type Query { @cacheControl(maxAge: 200) queryableFieldWithCollectionSegmentWithCacheControl(skip: Int, take: Int): QueryableFieldWithCollectionSegmentWithCacheControlCollectionSegment @cacheControl(maxAge: 200) - nested: NestedType! - nested2: NestedType2! pureField: String! pureFieldWithCacheControl: String! @cacheControl(maxAge: 200) } +type NestedType2 { + taskFieldWithInheritMaxAge: String! @cacheControl(inheritMaxAge: true) +} + +"Information about pagination in a connection." +type PageInfo { + "Indicates whether more edges exist following the set defined by the clients arguments." + hasNextPage: Boolean! + "Indicates whether more edges exist prior the set defined by the clients arguments." + hasPreviousPage: Boolean! + "When paginating backwards, the cursor to continue." + startCursor: String + "When paginating forwards, the cursor to continue." + endCursor: String +} + "A segment of a collection." type QueryableFieldWithCollectionSegmentCollectionSegment { "Information to aid in pagination." diff --git a/src/HotChocolate/Core/HotChocolate.Core.slnx b/src/HotChocolate/Core/HotChocolate.Core.slnx index 64c576bc86a..2afd01f5e5d 100644 --- a/src/HotChocolate/Core/HotChocolate.Core.slnx +++ b/src/HotChocolate/Core/HotChocolate.Core.slnx @@ -49,6 +49,7 @@ + diff --git a/src/HotChocolate/Core/src/Types.Abstractions/Features/TypeExtensionMarker.cs b/src/HotChocolate/Core/src/Types.Abstractions/Features/TypeExtensionMarker.cs new file mode 100644 index 00000000000..dff41502bc7 --- /dev/null +++ b/src/HotChocolate/Core/src/Types.Abstractions/Features/TypeExtensionMarker.cs @@ -0,0 +1,18 @@ +namespace HotChocolate.Features; + +/// +/// Marks a type definition as a type extension. The presence of this feature on a +/// type definition indicates that the canonical SDL formatter should emit the type +/// using the corresponding extend syntax (for example, extend type Foo). +/// +public sealed class TypeExtensionMarker +{ + /// + /// Gets the singleton marker instance. + /// + public static readonly TypeExtensionMarker Instance = new(); + + private TypeExtensionMarker() + { + } +} diff --git a/src/HotChocolate/Core/src/Types/ISchemaDocumentFormatter.cs b/src/HotChocolate/Core/src/Types.Abstractions/Serialization/ISchemaDocumentFormatter.cs similarity index 64% rename from src/HotChocolate/Core/src/Types/ISchemaDocumentFormatter.cs rename to src/HotChocolate/Core/src/Types.Abstractions/Serialization/ISchemaDocumentFormatter.cs index e5eb3364c60..e67be111bd0 100644 --- a/src/HotChocolate/Core/src/Types/ISchemaDocumentFormatter.cs +++ b/src/HotChocolate/Core/src/Types.Abstractions/Serialization/ISchemaDocumentFormatter.cs @@ -4,7 +4,7 @@ namespace HotChocolate; /// /// A schema document formatter can be used to format/rewrite the -/// schema document that is produced by a +/// schema document that is produced by an /// instance. /// public interface ISchemaDocumentFormatter @@ -12,11 +12,14 @@ public interface ISchemaDocumentFormatter /// /// Formats the schema document. /// + /// + /// The schema definition that produced the document. + /// /// /// The schema document that shall be formatted. /// /// /// Returns the formatted schema document. /// - DocumentNode Format(DocumentNode schemaDocument); + DocumentNode Format(ISchemaDefinition schema, DocumentNode schemaDocument); } diff --git a/src/HotChocolate/Fusion/src/Fusion.Execution.Types/Serialization/SchemaFormatter.cs b/src/HotChocolate/Core/src/Types.Abstractions/Serialization/SchemaFormatter.cs similarity index 69% rename from src/HotChocolate/Fusion/src/Fusion.Execution.Types/Serialization/SchemaFormatter.cs rename to src/HotChocolate/Core/src/Types.Abstractions/Serialization/SchemaFormatter.cs index 574b8a09897..2f4fbe9783a 100644 --- a/src/HotChocolate/Fusion/src/Fusion.Execution.Types/Serialization/SchemaFormatter.cs +++ b/src/HotChocolate/Core/src/Types.Abstractions/Serialization/SchemaFormatter.cs @@ -1,7 +1,7 @@ +using HotChocolate.Features; using HotChocolate.Language; using HotChocolate.Language.Utilities; using HotChocolate.Types; -using HotChocolate.Types.Mutable.Serialization; namespace HotChocolate.Serialization; @@ -17,11 +17,15 @@ public static class SchemaFormatter public static string FormatAsString( ISchemaDefinition schema, - SchemaFormatterOptions options = default) + SchemaFormatterOptions? options = null) { + ArgumentNullException.ThrowIfNull(schema); + + options ??= new SchemaFormatterOptions(); + var document = FormatAsDocument(schema, options); - if (options.Indented == false) + if (!options.Indented) { return document.ToString(false); } @@ -31,17 +35,34 @@ public static string FormatAsString( public static DocumentNode FormatAsDocument( ISchemaDefinition schema, - SchemaFormatterOptions options = default) + SchemaFormatterOptions? options = null) { + ArgumentNullException.ThrowIfNull(schema); + + options ??= new SchemaFormatterOptions(); + + var schemaDefaults = schema.Features.Get(); + var context = new VisitorContext { Schema = schema, - OrderByName = options.OrderByName ?? true, - PrintSpecScalars = options.PrintSpecScalars ?? false, - PrintSpecDirectives = options.PrintSpecDirectives ?? false + OrderTypesByName = options.OrderTypesByName ?? schemaDefaults?.OrderTypesByName ?? true, + OrderFieldsByName = options.OrderFieldsByName ?? schemaDefaults?.OrderFieldsByName ?? true, + PrintSpecScalars = options.PrintSpecScalars, + PrintSpecDirectives = options.PrintSpecDirectives, + IncludeInternalDirectives = options.IncludeInternalDirectives }; + s_visitor.VisitSchema(schema, context); - return (DocumentNode)context.Result!; + + var document = (DocumentNode)context.Result!; + + if (schema.Features.Get() is { } postProcessor) + { + document = postProcessor.Format(schema, document); + } + + return document; } private sealed class SchemaFormatterVisitor : SchemaDefinitionVisitor @@ -56,39 +77,52 @@ public override void VisitSchema(ISchemaDefinition schema, VisitorContext contex var definitions = new List(); - var operationTypes = new List - { - new(null, OperationType.Query, new NamedTypeNode(schema.QueryType.Name)) - }; + var hasQuery = schema.TryGetOperationType(OperationType.Query, out var queryType); + var hasMutation = schema.TryGetOperationType(OperationType.Mutation, out var mutationType); + var hasSubscription = schema.TryGetOperationType(OperationType.Subscription, out var subscriptionType); - if (schema.MutationType is not null) + if (hasQuery || hasMutation || hasSubscription || !string.IsNullOrEmpty(schema.Description)) { - operationTypes.Add( - new OperationTypeDefinitionNode( - null, - OperationType.Mutation, - new NamedTypeNode(schema.MutationType.Name))); - } + var operationTypes = new List(); - if (schema.SubscriptionType is not null) - { - operationTypes.Add( - new OperationTypeDefinitionNode( - null, - OperationType.Subscription, - new NamedTypeNode(schema.SubscriptionType.Name))); - } + if (hasQuery) + { + operationTypes.Add( + new OperationTypeDefinitionNode( + null, + OperationType.Query, + new NamedTypeNode(queryType!.Name))); + } - VisitDirectives(schema.Directives, context); + if (hasMutation) + { + operationTypes.Add( + new OperationTypeDefinitionNode( + null, + OperationType.Mutation, + new NamedTypeNode(mutationType!.Name))); + } - var schemaDefinition = new SchemaDefinitionNode( - null, - CreateDescription(schema.Description), - (IReadOnlyList)context.Result!, - operationTypes); - definitions.Add(schemaDefinition); + if (hasSubscription) + { + operationTypes.Add( + new OperationTypeDefinitionNode( + null, + OperationType.Subscription, + new NamedTypeNode(subscriptionType!.Name))); + } - if (context.OrderByName) + VisitDirectives(schema.Directives, context); + + var schemaDefinition = new SchemaDefinitionNode( + null, + CreateDescription(schema.Description), + (IReadOnlyList)context.Result!, + operationTypes); + definitions.Add(schemaDefinition); + } + + if (context.OrderTypesByName) { VisitTypes(schema.Types, context); definitions.AddRange((List)context.Result!); @@ -119,6 +153,11 @@ private void VisitTypesAndDirectives(ISchemaDefinition schema, VisitorContext co continue; } + if (!context.IncludeInternalDirectives && !directiveDefinition.IsPublic) + { + continue; + } + VisitDirectiveDefinition(directiveDefinition, context); definitionNodes.Add((IDefinitionNode)context.Result!); } @@ -146,18 +185,25 @@ public override void VisitTypes( { var definitionNodes = new List(); - VisitType(context.Schema.QueryType, context); - definitionNodes.Add((IDefinitionNode)context.Result!); + context.Schema.TryGetOperationType(OperationType.Query, out var queryType); + context.Schema.TryGetOperationType(OperationType.Mutation, out var mutationType); + context.Schema.TryGetOperationType(OperationType.Subscription, out var subscriptionType); + + if (queryType is not null) + { + VisitType(queryType, context); + definitionNodes.Add((IDefinitionNode)context.Result!); + } - if (context.Schema.MutationType is not null) + if (mutationType is not null) { - VisitType(context.Schema.MutationType, context); + VisitType(mutationType, context); definitionNodes.Add((IDefinitionNode)context.Result!); } - if (context.Schema.SubscriptionType is not null) + if (subscriptionType is not null) { - VisitType(context.Schema.SubscriptionType, context); + VisitType(subscriptionType, context); definitionNodes.Add((IDefinitionNode)context.Result!); } @@ -166,9 +212,9 @@ public override void VisitTypes( .Where(t => !t.IsIntrospectionType) .OrderBy(t => t.Name)) { - if (context.Schema?.QueryType == type - || context.Schema?.MutationType == type - || context.Schema?.SubscriptionType == type) + if (queryType == type + || mutationType == type + || subscriptionType == type) { continue; } @@ -238,13 +284,18 @@ public override void VisitDirectiveDefinitions( var definitionNodes = new List(); foreach (var type in directiveTypes - .OrderBy(t => t.Name, context.OrderByName)) + .OrderBy(t => t.Name, context.OrderTypesByName)) { if (DirectiveNames.IsSpecDirective(type.Name)) { continue; } + if (!context.IncludeInternalDirectives && !type.IsPublic) + { + continue; + } + VisitDirectiveDefinition(type, context); definitionNodes.Add((IDefinitionNode)context.Result!); } @@ -260,13 +311,21 @@ public override void VisitObjectType(IObjectTypeDefinition type, VisitorContext VisitOutputFields(type.Fields, context); var fields = (List)context.Result!; - context.Result = - new ObjectTypeDefinitionNode( + var interfaces = type.Implements.Select(t => new NamedTypeNode(t.Name)).ToList(); + + context.Result = IsTypeExtension(type) + ? new ObjectTypeExtensionNode( + null, + new NameNode(type.Name), + directives, + interfaces, + fields) + : new ObjectTypeDefinitionNode( null, new NameNode(type.Name), CreateDescription(type.Description), directives, - type.Implements.Select(t => new NamedTypeNode(t.Name)).ToList(), + interfaces, fields); } @@ -278,13 +337,21 @@ public override void VisitInterfaceType(IInterfaceTypeDefinition type, VisitorCo VisitOutputFields(type.Fields, context); var fields = (List)context.Result!; - context.Result = - new InterfaceTypeDefinitionNode( + var interfaces = type.Implements.AsEnumerable().Select(t => new NamedTypeNode(t.Name)).ToList(); + + context.Result = IsTypeExtension(type) + ? new InterfaceTypeExtensionNode( + null, + new NameNode(type.Name), + directives, + interfaces, + fields) + : new InterfaceTypeDefinitionNode( null, new NameNode(type.Name), CreateDescription(type.Description), directives, - type.Implements.AsEnumerable().Select(t => new NamedTypeNode(t.Name)).ToList(), + interfaces, fields); } @@ -296,8 +363,13 @@ public override void VisitInputObjectType(IInputObjectTypeDefinition type, Visit VisitInputFields(type.Fields, context); var fields = (List)context.Result!; - context.Result = - new InputObjectTypeDefinitionNode( + context.Result = IsTypeExtension(type) + ? new InputObjectTypeExtensionNode( + null, + new NameNode(type.Name), + directives, + fields) + : new InputObjectTypeDefinitionNode( null, new NameNode(type.Name), CreateDescription(type.Description), @@ -310,8 +382,23 @@ public override void VisitScalarType(IScalarTypeDefinition type, VisitorContext VisitDirectives(type.Directives, context); var directives = (List)context.Result!; - context.Result = - new ScalarTypeDefinitionNode( + if (type.SpecifiedBy is not null + && !directives.Any(d => d.Name.Value == DirectiveNames.SpecifiedBy.Name)) + { + directives.Add( + new DirectiveNode( + DirectiveNames.SpecifiedBy.Name, + new ArgumentNode( + DirectiveNames.SpecifiedBy.Arguments.Url, + new StringValueNode(type.SpecifiedBy.ToString())))); + } + + context.Result = IsTypeExtension(type) + ? new ScalarTypeExtensionNode( + null, + new NameNode(type.Name), + directives) + : new ScalarTypeDefinitionNode( null, new NameNode(type.Name), CreateDescription(type.Description), @@ -326,8 +413,13 @@ public override void VisitEnumType(IEnumTypeDefinition type, VisitorContext cont VisitEnumValues(type.Values, context); var values = (List)context.Result!; - context.Result = - new EnumTypeDefinitionNode( + context.Result = IsTypeExtension(type) + ? new EnumTypeExtensionNode( + null, + new NameNode(type.Name), + directives, + values) + : new EnumTypeDefinitionNode( null, new NameNode(type.Name), CreateDescription(type.Description), @@ -339,7 +431,7 @@ public override void VisitEnumValues(IReadOnlyEnumValueCollection values, Visito { var definitionNodes = new List(); - foreach (var value in values.AsEnumerable().OrderBy(t => t.Name, context.OrderByName)) + foreach (var value in values.AsEnumerable().OrderBy(t => t.Name, context.OrderFieldsByName)) { VisitEnumValue(value, context); definitionNodes.Add((EnumValueDefinitionNode)context.Result!); @@ -367,13 +459,20 @@ public override void VisitUnionType(IUnionTypeDefinition type, VisitorContext co VisitDirectives(type.Directives, context); var directives = (List)context.Result!; - context.Result = - new UnionTypeDefinitionNode( + var memberTypes = type.Types.AsEnumerable().Select(t => new NamedTypeNode(t.Name)).ToList(); + + context.Result = IsTypeExtension(type) + ? new UnionTypeExtensionNode( + null, + new NameNode(type.Name), + directives, + memberTypes) + : new UnionTypeDefinitionNode( null, new NameNode(type.Name), CreateDescription(type.Description), directives, - [.. type.Types.AsEnumerable().Select(t => new NamedTypeNode(t.Name))]); + memberTypes); } public override void VisitDirectiveDefinition( @@ -399,7 +498,7 @@ public override void VisitOutputFields( { var fieldNodes = new List(); - foreach (var field in fields.AsEnumerable().OrderBy(t => t.Name, context.OrderByName)) + foreach (var field in fields.AsEnumerable().OrderBy(t => t.Name, context.OrderFieldsByName)) { if (field.IsIntrospectionField) { @@ -438,7 +537,7 @@ public override void VisitInputFields( { var inputNodes = new List(); - foreach (var field in fields.AsEnumerable().OrderBy(t => t.Name, context.OrderByName)) + foreach (var field in fields.AsEnumerable().OrderBy(t => t.Name, context.OrderFieldsByName)) { VisitInputField(field, context); inputNodes.Add((InputValueDefinitionNode)context.Result!); @@ -469,6 +568,11 @@ public override void VisitDirectives(IReadOnlyDirectiveCollection directives, Vi foreach (var directive in directives) { + if (!context.IncludeInternalDirectives && !directive.Definition.IsPublic) + { + continue; + } + VisitDirective(directive, context); directiveNodes.Add((DirectiveNode)context.Result!); } @@ -478,31 +582,7 @@ public override void VisitDirectives(IReadOnlyDirectiveCollection directives, Vi public override void VisitDirective(IDirective directive, VisitorContext context) { - VisitArguments(directive.Arguments, context); - context.Result = new DirectiveNode( - null, - new NameNode(directive.Name), - (List)context.Result!); - } - - public override void VisitArguments( - ArgumentAssignmentCollection arguments, - VisitorContext context) - { - var argumentNodes = new List(); - - foreach (var argument in arguments) - { - VisitArgument(argument, context); - argumentNodes.Add((ArgumentNode)context.Result!); - } - - context.Result = argumentNodes; - } - - public override void VisitArgument(ArgumentAssignment argument, VisitorContext context) - { - context.Result = new ArgumentNode(argument.Name, argument.Value); + context.Result = directive.ToSyntaxNode(); } private static List ApplyDeprecatedDirective( @@ -530,11 +610,9 @@ private static List ApplyDeprecatedDirective( private static DirectiveNode CreateDeprecatedDirective(string? reason = null) { - const string defaultReason = "No longer supported."; - if (string.IsNullOrEmpty(reason)) { - reason = defaultReason; + reason = DirectiveNames.Deprecated.Arguments.DefaultReason; } return new DirectiveNode( @@ -556,18 +634,25 @@ private static DirectiveNode CreateDeprecatedDirective(string? reason = null) return new StringValueNode(null, description, isBlock); } + + private static bool IsTypeExtension(IFeatureProvider type) + => type.Features?.Get() is not null; } private sealed record VisitorContext { public required ISchemaDefinition Schema { get; init; } - public required bool OrderByName { get; init; } + public required bool OrderTypesByName { get; init; } + + public required bool OrderFieldsByName { get; init; } public required bool PrintSpecScalars { get; init; } public required bool PrintSpecDirectives { get; init; } + public required bool IncludeInternalDirectives { get; init; } + public object? Result { get; set; } } } diff --git a/src/HotChocolate/Core/src/Types.Abstractions/Serialization/SchemaFormatterOptions.cs b/src/HotChocolate/Core/src/Types.Abstractions/Serialization/SchemaFormatterOptions.cs new file mode 100644 index 00000000000..49303318bbc --- /dev/null +++ b/src/HotChocolate/Core/src/Types.Abstractions/Serialization/SchemaFormatterOptions.cs @@ -0,0 +1,48 @@ +namespace HotChocolate.Serialization; + +public sealed class SchemaFormatterOptions +{ + /// + /// Controls whether type definitions and directive definitions are emitted + /// in alphabetical order. + /// When null, the value is resolved from the schema-level + /// feature, falling back to true. + /// + public bool? OrderTypesByName { get; set; } + + /// + /// Controls whether fields, input fields, and enum values within a type are + /// emitted in alphabetical order. + /// When null, the value is resolved from the schema-level + /// feature, falling back to true. + /// + public bool? OrderFieldsByName { get; set; } + + /// + /// Controls whether the output is indented and pretty-printed. + /// Default: true. + /// + public bool Indented { get; set; } = true; + + /// + /// Controls whether GraphQL spec scalars (String, Int, Float, Boolean, ID) + /// are emitted as type definitions. + /// Default: false. + /// + public bool PrintSpecScalars { get; set; } + + /// + /// Controls whether GraphQL spec directives (@skip, @include, @deprecated, + /// @specifiedBy, @oneOf) are emitted as directive definitions. + /// Default: false. + /// + public bool PrintSpecDirectives { get; set; } + + /// + /// Controls whether directive definitions and applied directives whose + /// definition has + /// set to false are included in the output. + /// Default: true. + /// + public bool IncludeInternalDirectives { get; set; } = true; +} diff --git a/src/HotChocolate/Core/src/Types.Abstractions/Types/IDirectiveDefinition.cs b/src/HotChocolate/Core/src/Types.Abstractions/Types/IDirectiveDefinition.cs index 35c1b374174..d631914b615 100644 --- a/src/HotChocolate/Core/src/Types.Abstractions/Types/IDirectiveDefinition.cs +++ b/src/HotChocolate/Core/src/Types.Abstractions/Types/IDirectiveDefinition.cs @@ -29,6 +29,13 @@ public interface IDirectiveDefinition /// bool IsRepeatable { get; } + /// + /// Defines if this directive is publicly visible through introspection + /// and external SDL output. Internal directives are part of the type system + /// but hidden from external observers. + /// + bool IsPublic => true; + /// /// Gets the directive arguments. /// diff --git a/src/HotChocolate/Core/src/Types/AggregateSchemaDocumentFormatter.cs b/src/HotChocolate/Core/src/Types/AggregateSchemaDocumentFormatter.cs index ddbf12cfb83..098d1d28256 100644 --- a/src/HotChocolate/Core/src/Types/AggregateSchemaDocumentFormatter.cs +++ b/src/HotChocolate/Core/src/Types/AggregateSchemaDocumentFormatter.cs @@ -8,7 +8,7 @@ internal sealed class AggregateSchemaDocumentFormatter( { private readonly ISchemaDocumentFormatter[] _formatters = formatters?.ToArray() ?? []; - public DocumentNode Format(DocumentNode schemaDocument) + public DocumentNode Format(ISchemaDefinition schema, DocumentNode schemaDocument) { if (_formatters.Length == 0) { @@ -17,14 +17,14 @@ public DocumentNode Format(DocumentNode schemaDocument) if (_formatters.Length == 1) { - return _formatters[0].Format(schemaDocument); + return _formatters[0].Format(schema, schemaDocument); } var current = schemaDocument; for (var i = 0; i < _formatters.Length; i++) { - current = _formatters[i].Format(current); + current = _formatters[i].Format(schema, current); } return current; diff --git a/src/HotChocolate/Core/src/Types/Execution/RequestExecutorManager.cs b/src/HotChocolate/Core/src/Types/Execution/RequestExecutorManager.cs index 6eedd236801..968cca9e15f 100644 --- a/src/HotChocolate/Core/src/Types/Execution/RequestExecutorManager.cs +++ b/src/HotChocolate/Core/src/Types/Execution/RequestExecutorManager.cs @@ -468,6 +468,14 @@ private static async ValueTask CreateSchemaAsync( .SchemaBuilder .TryAddTypeInterceptor(new SetSchemaNameInterceptor(context.SchemaName)); + var schemaDocumentFormatter = new AggregateSchemaDocumentFormatter( + schemaServices.GetService>()); + + context + .SchemaBuilder + .AddSchemaConfiguration(d => + d.Extend().Configuration.Features.Set(schemaDocumentFormatter)); + var schema = context.SchemaBuilder.Create(descriptorContext); AssertSchemaNameValid(schema, context.SchemaName); return schema; diff --git a/src/HotChocolate/Core/src/Types/Schema.Initialization.cs b/src/HotChocolate/Core/src/Types/Schema.Initialization.cs index 3148d7c2bbb..20d968d6bfc 100644 --- a/src/HotChocolate/Core/src/Types/Schema.Initialization.cs +++ b/src/HotChocolate/Core/src/Types/Schema.Initialization.cs @@ -10,7 +10,6 @@ namespace HotChocolate; public partial class Schema { - private AggregateSchemaDocumentFormatter? _formatter; private FrozenDictionary> _possibleTypes = null!; private Action? _configure; private bool _sealed; diff --git a/src/HotChocolate/Core/src/Types/Schema.cs b/src/HotChocolate/Core/src/Types/Schema.cs index 621750373ca..602b9014f91 100644 --- a/src/HotChocolate/Core/src/Types/Schema.cs +++ b/src/HotChocolate/Core/src/Types/Schema.cs @@ -1,6 +1,7 @@ using System.Diagnostics.CodeAnalysis; using HotChocolate.Language; using HotChocolate.Language.Utilities; +using HotChocolate.Serialization; using HotChocolate.Types; using HotChocolate.Types.Descriptors.Configurations; using HotChocolate.Types.Relay; @@ -218,22 +219,11 @@ public bool TryGetRuntimeType(string typeName, [NotNullWhen(true)] out Type? run return null; } - /// - /// Creates a schema document from the current schema. - /// - public DocumentNode ToSyntaxNode(bool includeSpecScalars = false) - { - _formatter ??= new AggregateSchemaDocumentFormatter( - Services.GetService>()); - var document = SchemaPrinter.PrintSchema(this, includeSpecScalars); - return _formatter.Format(document); - } + public override string ToString() => ToSyntaxNode().Print(); + + public DocumentNode ToSyntaxNode() + => SchemaFormatter.FormatAsDocument(this); ISyntaxNode ISyntaxNodeProvider.ToSyntaxNode() => ToSyntaxNode(); - - /// - /// Returns the schema SDL representation. - /// - public override string ToString() => ToSyntaxNode().Print(); } diff --git a/src/HotChocolate/Core/src/Types/SchemaPrinter.cs b/src/HotChocolate/Core/src/Types/SchemaPrinter.cs deleted file mode 100644 index 4e4449efb4d..00000000000 --- a/src/HotChocolate/Core/src/Types/SchemaPrinter.cs +++ /dev/null @@ -1,518 +0,0 @@ -#nullable disable - -using HotChocolate.Language; -using HotChocolate.Language.Utilities; -using HotChocolate.Types; -using HotChocolate.Utilities; - -namespace HotChocolate; - -public static class SchemaPrinter -{ - public static string Print(Schema schema) - { - ArgumentNullException.ThrowIfNull(schema); - - var document = PrintSchema(schema); - return document.Print(); - } - - public static void Serialize(Schema schema, TextWriter textWriter) - { - ArgumentNullException.ThrowIfNull(schema); - ArgumentNullException.ThrowIfNull(textWriter); - - var document = PrintSchema(schema); - textWriter.Write(document.Print()); - } - - public static async ValueTask PrintAsync( - Schema schema, - Stream stream, - bool indented = true, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(schema); - ArgumentNullException.ThrowIfNull(stream); - - var document = PrintSchema(schema); - await document.PrintToAsync(stream, indented, cancellationToken).ConfigureAwait(false); - } - - public static async ValueTask PrintAsync( - IEnumerable typeDefinitions, - Stream stream, - bool indented = true, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(typeDefinitions); - ArgumentNullException.ThrowIfNull(stream); - - var list = new List(); - - foreach (var typeDefinition in typeDefinitions) - { - var syntaxNode = - typeDefinition is ScalarType scalarType - ? PrintScalarType(scalarType) - : PrintNonScalarTypeDefinition(typeDefinition, false); - list.Add(syntaxNode); - } - - await new DocumentNode(list) - .PrintToAsync(stream, indented, cancellationToken) - .ConfigureAwait(false); - } - - public static DocumentNode PrintSchema( - Schema schema, - bool includeSpecScalars = false, - bool printResolverKind = false) - { - ArgumentNullException.ThrowIfNull(schema); - - var typeDefinitions = GetNonScalarTypes(schema) - .Select(t => PrintNonScalarTypeDefinition(t, printResolverKind)) - .OfType() - .ToList(); - - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (schema.QueryType is not null - || schema.MutationType is not null - || schema.SubscriptionType is not null) - { - typeDefinitions.Insert(0, PrintSchemaTypeDefinition(schema)); - } - - var builtInDirectives = new HashSet - { - DirectiveNames.Skip.Name, - DirectiveNames.Include.Name, - DirectiveNames.Deprecated.Name - }; - - var directiveTypeDefinitions = - schema.DirectiveTypes - .Where(directive => !builtInDirectives.Contains(directive.Name)) - .OrderBy(t => t.Name, StringComparer.Ordinal) - .Select(PrintDirectiveTypeDefinition); - - typeDefinitions.AddRange(directiveTypeDefinitions); - - var scalarTypeDefinitions = - schema.Types - .OfType() - .Where(t => includeSpecScalars || !BuiltInTypes.IsBuiltInType(t.Name)) - .OrderBy(t => t.Name, StringComparer.Ordinal) - .Select(PrintScalarType); - - typeDefinitions.AddRange(scalarTypeDefinitions); - - return new DocumentNode(null, typeDefinitions); - } - - private static IEnumerable GetNonScalarTypes( - Schema schema) - { - return schema.Types - .Where(IsPublicAndNoScalar) - .OrderBy(t => t.Name, StringComparer.Ordinal) - .GroupBy(t => (int)t.Kind) - .OrderBy(t => t.Key) - .SelectMany(t => t); - } - - private static bool IsPublicAndNoScalar(ITypeDefinition type) - { - if (type.IsIntrospectionType() || type is ScalarType) - { - return false; - } - - return true; - } - - private static DirectiveDefinitionNode PrintDirectiveTypeDefinition( - DirectiveType directiveType) - { - var arguments = directiveType.Arguments - .Select(PrintInputField) - .ToList(); - - var locations = DirectiveLocationUtils.AsEnumerable(directiveType.Locations) - .Select(l => new NameNode(l.Format().ToString())) - .ToList(); - - return new DirectiveDefinitionNode - ( - null, - new NameNode(directiveType.Name), - PrintDescription(directiveType.Description), - directiveType.IsRepeatable, - arguments, - locations - ); - } - - private static SchemaDefinitionNode PrintSchemaTypeDefinition(Schema schema) - { - var operations = new List(); - - if (schema.QueryType is not null) - { - operations.Add(PrintOperationType( - schema.QueryType, - OperationType.Query)); - } - - if (schema.MutationType is not null) - { - operations.Add(PrintOperationType( - schema.MutationType, - OperationType.Mutation)); - } - - if (schema.SubscriptionType is not null) - { - operations.Add(PrintOperationType( - schema.SubscriptionType, - OperationType.Subscription)); - } - - var directives = schema.Directives - .Select(PrintDirective) - .ToList(); - - return new SchemaDefinitionNode - ( - null, - PrintDescription(schema.Description), - directives, - operations - ); - } - - private static OperationTypeDefinitionNode PrintOperationType( - ObjectType type, - OperationType operation) - { - return new( - null, - operation, - PrintNamedType(type)); - } - - private static ITypeDefinitionNode PrintNonScalarTypeDefinition( - ITypeDefinition typeDefinition, - bool printResolverKind) - => typeDefinition switch - { - ObjectType type => PrintObjectType(type, printResolverKind), - InterfaceType type => PrintInterfaceType(type), - InputObjectType type => PrintInputObjectType(type), - UnionType type => PrintUnionType(type), - EnumType type => PrintEnumType(type), - _ => throw new NotSupportedException() - }; - - private static ObjectTypeDefinitionNode PrintObjectType( - ObjectType objectType, - bool printResolverKind) - { - var directives = objectType.Directives - .Select(PrintDirective) - .ToList(); - - var interfaces = objectType.Implements - .Select(PrintNamedType) - .ToList(); - - var fields = objectType.Fields - .Where(t => !t.IsIntrospectionField) - .Select(f => PrintObjectField(f, printResolverKind)) - .ToList(); - - return new ObjectTypeDefinitionNode - ( - null, - new NameNode(objectType.Name), - PrintDescription(objectType.Description), - directives, - interfaces, - fields - ); - } - - private static InterfaceTypeDefinitionNode PrintInterfaceType( - InterfaceType interfaceType) - { - var directives = interfaceType.Directives - .Select(PrintDirective) - .ToList(); - - var interfaces = interfaceType.Implements - .Select(PrintNamedType) - .ToList(); - - var fields = interfaceType.Fields - .Select(PrintInterfaceField) - .ToList(); - - return new InterfaceTypeDefinitionNode - ( - null, - new NameNode(interfaceType.Name), - PrintDescription(interfaceType.Description), - directives, - interfaces, - fields - ); - } - - private static InputObjectTypeDefinitionNode PrintInputObjectType( - InputObjectType inputObjectType) - { - var directives = inputObjectType.Directives - .Select(PrintDirective) - .ToList(); - - var fields = inputObjectType.Fields - .Select(PrintInputField) - .ToList(); - - return new InputObjectTypeDefinitionNode - ( - null, - new NameNode(inputObjectType.Name), - PrintDescription(inputObjectType.Description), - directives, - fields - ); - } - - private static UnionTypeDefinitionNode PrintUnionType(UnionType unionType) - { - var directives = unionType.Directives - .Select(PrintDirective) - .ToList(); - - var types = unionType.Types - .Select(PrintNamedType) - .ToList(); - - return new UnionTypeDefinitionNode - ( - null, - new NameNode(unionType.Name), - PrintDescription(unionType.Description), - directives, - types - ); - } - - private static EnumTypeDefinitionNode PrintEnumType(EnumType enumType) - { - var directives = enumType.Directives - .Select(PrintDirective) - .ToList(); - - var values = enumType.Values - .Select(PrintEnumValue) - .ToList(); - - return new EnumTypeDefinitionNode - ( - null, - new NameNode(enumType.Name), - PrintDescription(enumType.Description), - directives, - values - ); - } - - private static EnumValueDefinitionNode PrintEnumValue(EnumValue enumValue) - { - var directives = enumValue.Directives - .Select(PrintDirective) - .ToList(); - - PrintDeprecationDirective( - directives, - enumValue.IsDeprecated, - enumValue.DeprecationReason); - - return new EnumValueDefinitionNode - ( - null, - new NameNode(enumValue.Name), - PrintDescription(enumValue.Description), - directives - ); - } - - private static ScalarTypeDefinitionNode PrintScalarType( - ScalarType scalarType) - { - var directives = scalarType.Directives - .Select(PrintDirective) - .ToList(); - - if (scalarType.SpecifiedBy is not null) - { - directives.Add( - new DirectiveNode( - DirectiveNames.SpecifiedBy.Name, - new ArgumentNode( - DirectiveNames.SpecifiedBy.Arguments.Url, - new StringValueNode(scalarType.SpecifiedBy.ToString())))); - } - - return new( - null, - new NameNode(scalarType.Name), - PrintDescription(scalarType.Description), - directives); - } - - private static FieldDefinitionNode PrintObjectField( - ObjectField field, - bool printResolverKind) - { - var arguments = field.Arguments - .Select(PrintInputField) - .ToList(); - - var directives = field.Directives - .Select(PrintDirective) - .ToList(); - - PrintDeprecationDirective( - directives, - field.IsDeprecated, - field.DeprecationReason); - - if (printResolverKind && field.PureResolver is not null) - { - directives.Add(new DirectiveNode("pureResolver")); - } - - return new FieldDefinitionNode - ( - null, - new NameNode(field.Name), - PrintDescription(field.Description), - arguments, - PrintType(field.Type), - directives - ); - } - - private static FieldDefinitionNode PrintInterfaceField( - InterfaceField field) - { - var arguments = field.Arguments - .Select(PrintInputField) - .ToList(); - - var directives = field.Directives - .Select(PrintDirective) - .ToList(); - - PrintDeprecationDirective( - directives, - field.IsDeprecated, - field.DeprecationReason); - - return new FieldDefinitionNode - ( - null, - new NameNode(field.Name), - PrintDescription(field.Description), - arguments, - PrintType(field.Type), - directives - ); - } - - private static void PrintDeprecationDirective( - ICollection directives, - bool isDeprecated, - string deprecationReason) - { - if (isDeprecated) - { - if (DirectiveNames.Deprecated.Arguments.DefaultReason.EqualsOrdinal(deprecationReason)) - { - directives.Add(new DirectiveNode(DirectiveNames.Deprecated.Name)); - } - else - { - directives.Add(new DirectiveNode( - DirectiveNames.Deprecated.Name, - new ArgumentNode( - DirectiveNames.Deprecated.Arguments.Reason, - deprecationReason))); - } - } - } - - private static InputValueDefinitionNode PrintInputField( - IInputValueDefinition inputValue) - { - var directives = inputValue.Directives - .Select(PrintDirective) - .ToList(); - - PrintDeprecationDirective( - directives, - inputValue.IsDeprecated, - inputValue.DeprecationReason); - - return new( - null, - new NameNode(inputValue.Name), - PrintDescription(inputValue.Description), - PrintType(inputValue.Type), - inputValue.DefaultValue, - directives); - } - - private static ITypeNode PrintType(IType type) - { - if (type is NonNullType nt) - { - return new NonNullTypeNode(null, (INullableTypeNode)PrintType(nt.NullableType)); - } - - if (type is ListType lt) - { - return new ListTypeNode(null, PrintType(lt.ElementType)); - } - - if (type is ITypeDefinition namedType) - { - return PrintNamedType(namedType); - } - - throw new NotSupportedException(); - } - - private static NamedTypeNode PrintNamedType(ITypeDefinition namedType) - => new(null, new NameNode(namedType.Name)); - - private static DirectiveNode PrintDirective(IDirective directive) - => directive.ToSyntaxNode(); - - private static StringValueNode PrintDescription(string description) - { - if (string.IsNullOrEmpty(description)) - { - return null; - } - - // Get rid of any unnecessary whitespace. - description = description.Trim(); - var isBlock = description.AsSpan().Contains('\n'); - return new StringValueNode(null, description, isBlock); - } -} diff --git a/src/HotChocolate/Core/src/Types/StoreGlobalSchemaOptionsTypeInterceptor.cs b/src/HotChocolate/Core/src/Types/StoreGlobalSchemaOptionsTypeInterceptor.cs index 1a5f06d1c07..9e1f917ae38 100644 --- a/src/HotChocolate/Core/src/Types/StoreGlobalSchemaOptionsTypeInterceptor.cs +++ b/src/HotChocolate/Core/src/Types/StoreGlobalSchemaOptionsTypeInterceptor.cs @@ -1,4 +1,5 @@ using HotChocolate.Configuration; +using HotChocolate.Serialization; using HotChocolate.Types.Descriptors.Configurations; namespace HotChocolate; @@ -13,6 +14,11 @@ public override void OnBeforeCompleteType( { var options = completionContext.DescriptorContext.Options; schemaDef.Features.Set(options); + schemaDef.Features.Set( + new SchemaFormatterOptions + { + OrderFieldsByName = options.SortFieldsByName + }); } } } diff --git a/src/HotChocolate/Core/src/Types/Types/DirectiveType.cs b/src/HotChocolate/Core/src/Types/Types/DirectiveType.cs index cf4d3395efc..69dd85a90ef 100644 --- a/src/HotChocolate/Core/src/Types/Types/DirectiveType.cs +++ b/src/HotChocolate/Core/src/Types/Types/DirectiveType.cs @@ -126,7 +126,7 @@ IReadOnlyFieldDefinitionCollection IDirectiveDefinition.A /// /// Defines if instances of this directive type are publicly visible through introspection. /// - internal bool IsPublic { get; private set; } + public bool IsPublic { get; private set; } private Type? TypeIdentity { get; set; } diff --git a/src/HotChocolate/Core/test/Authorization.Tests/__snapshots__/AnnotationBasedAuthorizationTests.Authorize_Node_Field_Schema.graphql b/src/HotChocolate/Core/test/Authorization.Tests/__snapshots__/AnnotationBasedAuthorizationTests.Authorize_Node_Field_Schema.graphql index b22e890e010..a0f897c9ed9 100644 --- a/src/HotChocolate/Core/test/Authorization.Tests/__snapshots__/AnnotationBasedAuthorizationTests.Authorize_Node_Field_Schema.graphql +++ b/src/HotChocolate/Core/test/Authorization.Tests/__snapshots__/AnnotationBasedAuthorizationTests.Authorize_Node_Field_Schema.graphql @@ -2,29 +2,6 @@ schema { query: Query } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! -} - -type BlogPage implements Node { - id: ID! -} - -type City @authorize(policy: "READ_CITY", apply: AFTER_RESOLVER) { - value: String -} - -type Order implements Node @authorize { - id: ID! -} - -type Person implements Node - @authorize(policy: "READ_PERSON", apply: AFTER_RESOLVER) { - id: ID! - name: String -} - type Query @foo @authorize(policy: "QUERY", apply: VALIDATION) @@ -48,11 +25,34 @@ type Query test: ID! } +type BlogPage implements Node { + id: ID! +} + +type City @authorize(policy: "READ_CITY", apply: AFTER_RESOLVER) { + value: String +} + +type Order implements Node @authorize { + id: ID! +} + +type Person implements Node + @authorize(policy: "READ_PERSON", apply: AFTER_RESOLVER) { + id: ID! + name: String +} + type Street implements Node @authorize(policy: "READ_STREET_ON_TYPE") { value: String id: ID! @cost(weight: "10") } +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! +} + union ICityOrStreet = Street | City "Defines when a policy shall be executed." diff --git a/src/HotChocolate/Core/test/Execution.Tests/Configuration/__snapshots__/TypeModuleTests.Extend_Type_From_TypeModule.snap b/src/HotChocolate/Core/test/Execution.Tests/Configuration/__snapshots__/TypeModuleTests.Extend_Type_From_TypeModule.snap index c3a92bf3581..e2161d7c7f4 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Configuration/__snapshots__/TypeModuleTests.Extend_Type_From_TypeModule.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/Configuration/__snapshots__/TypeModuleTests.Extend_Type_From_TypeModule.snap @@ -1,13 +1,13 @@ -schema { +schema { query: Query } -type Person { - name: String! - dynamic: String! -} - type Query { hello: String! person: Person! } + +type Person { + name: String! + dynamic: String! +} diff --git a/src/HotChocolate/Core/test/Execution.Tests/Errors/__snapshots__/ErrorBehaviorTests.MatchTestSchema.graphql b/src/HotChocolate/Core/test/Execution.Tests/Errors/__snapshots__/ErrorBehaviorTests.MatchTestSchema.graphql index 72df3947d1f..184632094eb 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Errors/__snapshots__/ErrorBehaviorTests.MatchTestSchema.graphql +++ b/src/HotChocolate/Core/test/Execution.Tests/Errors/__snapshots__/ErrorBehaviorTests.MatchTestSchema.graphql @@ -2,10 +2,6 @@ schema { query: Query } -type Foo { - bar: String -} - type Query { error3: String error6: String @@ -23,3 +19,7 @@ type Query { error14: String error15: String! } + +type Foo { + bar: String +} diff --git a/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoaderAttribute_Schema_GroupedDataloader_Many.snap b/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoaderAttribute_Schema_GroupedDataloader_Many.snap index 42dfa5d5121..0719b2c390c 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoaderAttribute_Schema_GroupedDataloader_Many.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoaderAttribute_Schema_GroupedDataloader_Many.snap @@ -1,11 +1,11 @@ -schema { +schema { query: GroupedQuery } -type Foo { - id: Int! -} - type GroupedQuery { multiple: [Foo] } + +type Foo { + id: Int! +} diff --git a/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoaderAttribute_Schema_GroupedDataloader_Single.snap b/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoaderAttribute_Schema_GroupedDataloader_Single.snap index 2ac040f4b38..9eb97736c7e 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoaderAttribute_Schema_GroupedDataloader_Single.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoaderAttribute_Schema_GroupedDataloader_Single.snap @@ -1,11 +1,11 @@ -schema { +schema { query: GroupedQuery } -type Foo { - id: Int! -} - type GroupedQuery { single: [Foo] } + +type Foo { + id: Int! +} diff --git a/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_BatchDataloader_Many.snap b/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_BatchDataloader_Many.snap index 180de619963..c8ea7c1e0db 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_BatchDataloader_Many.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_BatchDataloader_Many.snap @@ -1,11 +1,11 @@ -schema { +schema { query: Query } -type Foo { - id: Int! -} - type Query { multiple: [Foo] } + +type Foo { + id: Int! +} diff --git a/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_BatchDataloader_Single.snap b/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_BatchDataloader_Single.snap index 30eb7aba987..64102eedc8e 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_BatchDataloader_Single.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_BatchDataloader_Single.snap @@ -1,11 +1,11 @@ -schema { +schema { query: Query } -type Foo { - id: Int! -} - type Query { single: Foo } + +type Foo { + id: Int! +} diff --git a/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_GroupedDataloader_Many.snap b/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_GroupedDataloader_Many.snap index 180de619963..c8ea7c1e0db 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_GroupedDataloader_Many.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_GroupedDataloader_Many.snap @@ -1,11 +1,11 @@ -schema { +schema { query: Query } -type Foo { - id: Int! -} - type Query { multiple: [Foo] } + +type Foo { + id: Int! +} diff --git a/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_GroupedDataloader_Single.snap b/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_GroupedDataloader_Single.snap index 9ba15272409..2e1c11138c3 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_GroupedDataloader_Single.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/__snapshots__/UseDataLoaderTests.UseDataLoader_Schema_GroupedDataloader_Single.snap @@ -1,11 +1,11 @@ -schema { +schema { query: Query } -type Foo { - id: Int! -} - type Query { single: [Foo] } + +type Foo { + id: Int! +} diff --git a/src/HotChocolate/Core/test/Execution.Tests/Integration/StarWarsCodeFirst/__snapshots__/StarWarsCodeFirstTests.Schema.snap b/src/HotChocolate/Core/test/Execution.Tests/Integration/StarWarsCodeFirst/__snapshots__/StarWarsCodeFirstTests.Schema.snap index 414234c23f4..ec2cf5be117 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Integration/StarWarsCodeFirst/__snapshots__/StarWarsCodeFirstTests.Schema.snap +++ b/src/HotChocolate/Core/test/Execution.Tests/Integration/StarWarsCodeFirst/__snapshots__/StarWarsCodeFirstTests.Schema.snap @@ -4,22 +4,23 @@ schema { subscription: Subscription } -interface Character { - id: ID! - name: String! - friends( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): FriendsConnection - appearsIn: [Episode] - traits: Any - height(unit: Unit): Float +type Query { + hero(episode: Episode! = NEW_HOPE): Character + heroByTraits(traits: Any!): Character + heroes(episodes: [Episode!]!): [Character!] + character(characterIds: [String!]!): [Character!]! + search(text: String!): [SearchResult] + human(id: String!): Human + droid(id: String!): Droid +} + +type Mutation { + createReview(episode: Episode!, review: ReviewInput!): Review! + complete(episode: Episode!): Boolean! +} + +type Subscription { + onReview(episode: Episode!): Review! } type Droid implements Character { @@ -79,11 +80,6 @@ type Human implements Character { traits: Any } -type Mutation { - createReview(episode: Episode!, review: ReviewInput!): Review! - complete(episode: Episode!): Boolean! -} - "Information about pagination in a connection." type PageInfo { "Indicates whether more edges exist following the set defined by the clients arguments." @@ -96,16 +92,6 @@ type PageInfo { endCursor: String } -type Query { - hero(episode: Episode! = NEW_HOPE): Character - heroByTraits(traits: Any!): Character - heroes(episodes: [Episode!]!): [Character!] - character(characterIds: [String!]!): [Character!]! - search(text: String!): [SearchResult] - human(id: String!): Human - droid(id: String!): Droid -} - type Review { commentary: String stars: Int! @@ -117,8 +103,22 @@ type Starship { length(unit: Unit): Float! } -type Subscription { - onReview(episode: Episode!): Review! +interface Character { + id: ID! + name: String! + friends( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): FriendsConnection + appearsIn: [Episode] + traits: Any + height(unit: Unit): Float } union SearchResult = Starship | Human | Droid @@ -139,11 +139,5 @@ enum Unit { METERS } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `Any` scalar type represents any valid GraphQL value." scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") diff --git a/src/HotChocolate/Core/test/Types.Abstractions.Tests/HotChocolate.Types.Abstractions.Tests.csproj b/src/HotChocolate/Core/test/Types.Abstractions.Tests/HotChocolate.Types.Abstractions.Tests.csproj new file mode 100644 index 00000000000..2446722e21f --- /dev/null +++ b/src/HotChocolate/Core/test/Types.Abstractions.Tests/HotChocolate.Types.Abstractions.Tests.csproj @@ -0,0 +1,13 @@ + + + + HotChocolate.Types.Abstractions.Tests + HotChocolate + + + + + + + + diff --git a/src/HotChocolate/Core/test/Types.Abstractions.Tests/Serialization/SchemaDocumentFormatterTests.cs b/src/HotChocolate/Core/test/Types.Abstractions.Tests/Serialization/SchemaDocumentFormatterTests.cs new file mode 100644 index 00000000000..19df15730a1 --- /dev/null +++ b/src/HotChocolate/Core/test/Types.Abstractions.Tests/Serialization/SchemaDocumentFormatterTests.cs @@ -0,0 +1,115 @@ +using System.Text; +using HotChocolate.Language; +using HotChocolate.Types.Mutable.Serialization; + +namespace HotChocolate.Serialization; + +public class SchemaDocumentFormatterTests +{ + [Fact] + public void Format_Without_Formatter_Feature_Returns_Document_Unchanged() + { + // arrange + const string sdl = + """ + type Query { + hello: String! + } + """; + var schema = SchemaParser.Parse(Encoding.UTF8.GetBytes(sdl)); + + // act + var formattedSdl = SchemaFormatter.FormatAsString(schema); + + // assert + formattedSdl.MatchInlineSnapshot( + """ + schema { + query: Query + } + + type Query { + hello: String! + } + """); + } + + [Fact] + public void Format_With_Formatter_Feature_Invokes_Formatter() + { + // arrange + const string sdl = + """ + type Query { + hello: String! + } + """; + var schema = SchemaParser.Parse(Encoding.UTF8.GetBytes(sdl)); + schema.Features.Set(new AppendScalarFormatter("Scalar1")); + + // act + var formattedSdl = SchemaFormatter.FormatAsString(schema); + + // assert + formattedSdl.MatchInlineSnapshot( + """ + schema { + query: Query + } + + type Query { + hello: String! + } + + scalar Scalar1 + """); + } + + [Fact] + public void Format_Formatter_Receives_Schema() + { + // arrange + const string sdl = + """ + type Query { + hello: String! + } + """; + var schema = SchemaParser.Parse(Encoding.UTF8.GetBytes(sdl)); + ISchemaDefinition? receivedSchema = null; + schema.Features.Set( + new DelegateFormatter((s, d) => + { + receivedSchema = s; + return d; + })); + + // act + SchemaFormatter.FormatAsString(schema); + + // assert + Assert.Same(schema, receivedSchema); + } + + private sealed class AppendScalarFormatter(string scalarName) : ISchemaDocumentFormatter + { + public DocumentNode Format(ISchemaDefinition schema, DocumentNode schemaDocument) + { + var definitions = schemaDocument.Definitions.ToList(); + definitions.Add( + new ScalarTypeDefinitionNode( + null, + new NameNode(scalarName), + null, + [])); + return new DocumentNode(null, definitions); + } + } + + private sealed class DelegateFormatter(Func format) + : ISchemaDocumentFormatter + { + public DocumentNode Format(ISchemaDefinition schema, DocumentNode schemaDocument) + => format(schema, schemaDocument); + } +} diff --git a/src/HotChocolate/Mutable/test/Types.Mutable.Tests/SchemaFormatterTests.cs b/src/HotChocolate/Core/test/Types.Abstractions.Tests/Serialization/SchemaFormatterTests.cs similarity index 51% rename from src/HotChocolate/Mutable/test/Types.Mutable.Tests/SchemaFormatterTests.cs rename to src/HotChocolate/Core/test/Types.Abstractions.Tests/Serialization/SchemaFormatterTests.cs index 9dac1b65bf4..dcda50ac5da 100644 --- a/src/HotChocolate/Mutable/test/Types.Mutable.Tests/SchemaFormatterTests.cs +++ b/src/HotChocolate/Core/test/Types.Abstractions.Tests/Serialization/SchemaFormatterTests.cs @@ -1,10 +1,30 @@ using System.Text; using HotChocolate.Types.Mutable.Serialization; -namespace HotChocolate.Types.Mutable; +namespace HotChocolate.Serialization; public class SchemaFormatterTests { + [Fact] + public void FormatAsString_Schema_Is_Null_Throws() + { + // arrange & act + void Act() => SchemaFormatter.FormatAsString(null!); + + // assert + Assert.Throws(Act); + } + + [Fact] + public void FormatAsDocument_Schema_Is_Null_Throws() + { + // arrange & act + void Act() => SchemaFormatter.FormatAsDocument(null!); + + // assert + Assert.Throws(Act); + } + [Fact] public void Format_Single_InputObject_Type() { @@ -148,6 +168,85 @@ extend type Foo { """); } + [Fact] + public void Format_Object_Type_With_Extension_Of_Same_Name() + { + // arrange + const string sdl = + """ + type Query { + product: Product + } + + type Product { + id: ID! + name: String! + } + + extend type Product { + price: Float! + } + """; + var schema = SchemaParser.Parse(Encoding.UTF8.GetBytes(sdl)); + + // act + var formattedSdl = SchemaFormatter.FormatAsString(schema); + + // assert + formattedSdl.MatchInlineSnapshot( + """ + schema { + query: Query + } + + type Query { + product: Product + } + + type Product { + id: ID! + name: String! + price: Float! + } + """); + } + + [Fact] + public void Format_Standalone_Object_Type_Extension_Without_Base_Type() + { + // arrange + const string sdl = + """ + type Query { + product: Product + } + + extend type Product { + price: Float! + } + """; + var schema = SchemaParser.Parse(Encoding.UTF8.GetBytes(sdl)); + + // act + var formattedSdl = SchemaFormatter.FormatAsString(schema); + + // assert + formattedSdl.MatchInlineSnapshot( + """ + schema { + query: Query + } + + type Query { + product: Product + } + + extend type Product { + price: Float! + } + """); + } + [Fact] public void Format_Single_Interface_Type() { @@ -277,7 +376,9 @@ input Bar { var schema = SchemaParser.Parse(Encoding.UTF8.GetBytes(sdl)); // act - var formattedSdl = SchemaFormatter.FormatAsString(schema, new SchemaFormatterOptions { OrderByName = false }); + var formattedSdl = SchemaFormatter.FormatAsString( + schema, + new SchemaFormatterOptions { OrderTypesByName = false, OrderFieldsByName = false }); // assert formattedSdl.MatchInlineSnapshot( @@ -294,6 +395,135 @@ input Bar { """); } + [Fact] + public void Format_Schema_With_Mutation_Without_Subscription() + { + // arrange + const string sdl = + """ + type Query { + foo: Foo + } + + type Mutation { + mutate: String + } + + type Foo implements Bar { + id: ID! + } + + interface Bar { + id: ID! + } + + type Baz { + name("some comment" baz: BazInput): String + } + + union FooOrBaz = Foo | Baz + + input BazInput { + name: String + } + """; + var schema = SchemaParser.Parse(Encoding.UTF8.GetBytes(sdl)); + + // act + var formattedSdl = SchemaFormatter.FormatAsString(schema); + + // assert + formattedSdl.MatchInlineSnapshot( + """ + schema { + query: Query + mutation: Mutation + } + + type Query { + foo: Foo + } + + type Mutation { + mutate: String + } + + type Baz { + name("some comment" baz: BazInput): String + } + + type Foo implements Bar { + id: ID! + } + + interface Bar { + id: ID! + } + + union FooOrBaz = Foo | Baz + + input BazInput { + name: String + } + """); + } + + [Fact] + public void Format_Schema_With_Applied_Directive_On_Interface_Field() + { + // arrange + const string sdl = + """ + type Foo implements Bar { + id: ID! + } + + interface Bar { + id: ID! @upper + } + + type Baz { + name(baz: BazInput): String + } + + union FooOrBaz = Foo | Baz + + input BazInput { + name: String + } + + directive @upper on FIELD_DEFINITION + """; + var schema = SchemaParser.Parse(Encoding.UTF8.GetBytes(sdl)); + + // act + var formattedSdl = SchemaFormatter.FormatAsString(schema); + + // assert + formattedSdl.MatchInlineSnapshot( + """ + type Baz { + name(baz: BazInput): String + } + + type Foo implements Bar { + id: ID! + } + + interface Bar { + id: ID! @upper + } + + union FooOrBaz = Foo | Baz + + input BazInput { + name: String + } + + directive @upper on FIELD_DEFINITION + """); + } + [Fact] public void Format_Schema_With_Description_Schema_Keyword_Not_Omitted() { @@ -323,4 +553,72 @@ type Mutation { // assert formattedSdl.MatchInlineSnapshot(sdl); } + + [Fact] + public void Format_IncludeInternalDirectives_True_Emits_Internal_Directive_Definition() + { + // arrange + const string sdl = + """ + type Query { + foo: String @internalDir + } + + directive @internalDir on FIELD_DEFINITION + """; + var schema = SchemaParser.Parse(Encoding.UTF8.GetBytes(sdl)); + schema.DirectiveDefinitions["internalDir"].IsPublic = false; + + // act + var formattedSdl = SchemaFormatter.FormatAsString( + schema, + new SchemaFormatterOptions { IncludeInternalDirectives = true }); + + // assert + formattedSdl.MatchInlineSnapshot( + """ + schema { + query: Query + } + + type Query { + foo: String @internalDir + } + + directive @internalDir on FIELD_DEFINITION + """); + } + + [Fact] + public void Format_IncludeInternalDirectives_False_Strips_Internal_Directive_Definition() + { + // arrange + const string sdl = + """ + type Query { + foo: String @internalDir + } + + directive @internalDir on FIELD_DEFINITION + """; + var schema = SchemaParser.Parse(Encoding.UTF8.GetBytes(sdl)); + schema.DirectiveDefinitions["internalDir"].IsPublic = false; + + // act + var formattedSdl = SchemaFormatter.FormatAsString( + schema, + new SchemaFormatterOptions { IncludeInternalDirectives = false }); + + // assert + formattedSdl.MatchInlineSnapshot( + """ + schema { + query: Query + } + + type Query { + foo: String + } + """); + } } diff --git a/src/HotChocolate/Core/test/Types.Analyzers.Integration.Tests/__snapshots__/IntegrationTests.Schema_Snapshot.snap b/src/HotChocolate/Core/test/Types.Analyzers.Integration.Tests/__snapshots__/IntegrationTests.Schema_Snapshot.snap index 1a1918f142e..209c96230b3 100644 --- a/src/HotChocolate/Core/test/Types.Analyzers.Integration.Tests/__snapshots__/IntegrationTests.Schema_Snapshot.snap +++ b/src/HotChocolate/Core/test/Types.Analyzers.Integration.Tests/__snapshots__/IntegrationTests.Schema_Snapshot.snap @@ -2,14 +2,50 @@ schema { query: Query } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! -} - -interface Product { - kind: String! - id: String! +type Query { + isSelectedTest: IsSelectedNode! + """ + Gets the product. + + + **Returns:** + The only product. + """ + product: Product! + ints( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): IntsConnection + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) + products( + "Returns the elements in the list that come after the specified cursor." + after: Version2 + "Returns the first _n_ elements from the list." + first: Int + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): ProductsConnection + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) + @cost(weight: "10") + argumentWithExplicitType(arg: Version2): String! + nullableArgumentWithExplicitType(arg: Version2): String! + nullableArrayArgumentRef(items: [String!]): String! + arrayArgumentRef(items: [String!]!): String! + arrayNullableElementArgumentRef(items: [String]!): String! + nullableArrayNullableElementArgumentRef(items: [String]): String! + nullableListArgumentRef(items: [String!]): String! + listArgumentRef(items: [String!]!): String! + listNullableElementArgumentRef(items: [String]!): String! + nullableListNullableElementArgumentRef(items: [String]): String! + issue8057Entity(id: ID!): Issue8057Entity @cost(weight: "10") } type Book implements Product { @@ -77,52 +113,6 @@ type ProductsEdge { node: Product! } -type Query { - isSelectedTest: IsSelectedNode! - """ - Gets the product. - - - **Returns:** - The only product. - """ - product: Product! - ints( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): IntsConnection - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) - products( - "Returns the elements in the list that come after the specified cursor." - after: Version2 - "Returns the first _n_ elements from the list." - first: Int - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): ProductsConnection - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) - @cost(weight: "10") - argumentWithExplicitType(arg: Version2): String! - nullableArgumentWithExplicitType(arg: Version2): String! - nullableArrayArgumentRef(items: [String!]): String! - arrayArgumentRef(items: [String!]!): String! - arrayNullableElementArgumentRef(items: [String]!): String! - nullableArrayNullableElementArgumentRef(items: [String]): String! - nullableListArgumentRef(items: [String!]): String! - listArgumentRef(items: [String!]!): String! - listNullableElementArgumentRef(items: [String]!): String! - nullableListNullableElementArgumentRef(items: [String]): String! - issue8057Entity(id: ID!): Issue8057Entity @cost(weight: "10") -} - type Television implements Product { argumentWithExplicitType(arg: Version!): String! nullableArgumentWithExplicitType(arg: Version): String! @@ -130,6 +120,20 @@ type Television implements Product { kind: String! } +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! +} + +interface Product { + kind: String! + id: String! +} + +scalar Version + +scalar Version2 + "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." directive @cost( "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." @@ -149,7 +153,3 @@ directive @listSize( "The `requireOneSlicingArgument` argument can be used to inform the static analysis that it should expect that exactly one of the defined slicing arguments is present in a query. If that is not the case (i.e., if none or multiple slicing arguments are present), the static analysis may throw an error." requireOneSlicingArgument: Boolean = true ) on FIELD_DEFINITION - -scalar Version - -scalar Version2 diff --git a/src/HotChocolate/Core/test/Types.Analyzers.Tests/__snapshots__/IntegrationTests.Schema.graphql b/src/HotChocolate/Core/test/Types.Analyzers.Tests/__snapshots__/IntegrationTests.Schema.graphql index e1ca733652e..75009d46a95 100644 --- a/src/HotChocolate/Core/test/Types.Analyzers.Tests/__snapshots__/IntegrationTests.Schema.graphql +++ b/src/HotChocolate/Core/test/Types.Analyzers.Tests/__snapshots__/IntegrationTests.Schema.graphql @@ -3,14 +3,40 @@ schema { mutation: Mutation } -interface Entity { - idString: String! - id: ID! +type Query { + "Fetches an object given its ID." + node("ID of the object." id: ID!): Node + "Lookup nodes by a list of IDs." + nodes("The list of node IDs." ids: [ID!]!): [Node]! + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + authorById(id: ID!): Author + addressById(id: Int!): Address + queryFieldCollocatedWithAuthor: String! + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + bookById(id: Int!): Book + staticField: String! } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! +type Mutation { + createBook(input: CreateBookInput!): CreateBookPayload! } type Address { @@ -133,10 +159,6 @@ type CreateBookPayload { book: Book } -type Mutation { - createBook(input: CreateBookInput!): CreateBookPayload! -} - "Information about pagination in a connection." type PageInfo { "Indicates whether more edges exist following the set defined by the clients arguments." @@ -149,36 +171,14 @@ type PageInfo { endCursor: String } -type Query { - "Fetches an object given its ID." - node("ID of the object." id: ID!): Node - "Lookup nodes by a list of IDs." - nodes("The list of node IDs." ids: [ID!]!): [Node]! - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - authorById(id: ID!): Author - addressById(id: Int!): Address - queryFieldCollocatedWithAuthor: String! - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - bookById(id: Int!): Book - staticField: String! +interface Entity { + idString: String! + id: ID! +} + +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! } input CreateBookInput { diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/CustomCursorHandlerTests.Infer_Schema_Correctly_When_Connection_IsUsed.snap b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/CustomCursorHandlerTests.Infer_Schema_Correctly_When_Connection_IsUsed.snap index 8c2a73631f0..58c2d08eef0 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/CustomCursorHandlerTests.Infer_Schema_Correctly_When_Connection_IsUsed.snap +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/CustomCursorHandlerTests.Infer_Schema_Correctly_When_Connection_IsUsed.snap @@ -2,6 +2,19 @@ schema { query: Query } +type Query { + items( + "Returns the first _n_ elements from the list." + first: Int = 10 + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): ItemsConnection +} + "A connection to a list of items." type ItemsConnection { "Information to aid in pagination." @@ -31,16 +44,3 @@ type PageInfo { "When paginating forwards, the cursor to continue." endCursor: String } - -type Query { - items( - "Returns the first _n_ elements from the list." - first: Int = 10 - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): ItemsConnection -} diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/EdgeTests.Extend_Edge_Type_And_Inject_Edge_Value_Schema.snap b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/EdgeTests.Extend_Edge_Type_And_Inject_Edge_Value_Schema.snap index 5e2fcdaf2ba..0b37d286525 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/EdgeTests.Extend_Edge_Type_And_Inject_Edge_Value_Schema.snap +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/EdgeTests.Extend_Edge_Type_And_Inject_Edge_Value_Schema.snap @@ -2,18 +2,6 @@ schema { query: Query } -"Information about pagination in a connection." -type PageInfo { - "Indicates whether more edges exist following the set defined by the clients arguments." - hasNextPage: Boolean! - "Indicates whether more edges exist prior the set defined by the clients arguments." - hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String - "When paginating forwards, the cursor to continue." - endCursor: String -} - type Query { users( "Returns the first _n_ elements from the list." @@ -27,6 +15,18 @@ type Query { ): UsersConnection } +"Information about pagination in a connection." +type PageInfo { + "Indicates whether more edges exist following the set defined by the clients arguments." + hasNextPage: Boolean! + "Indicates whether more edges exist prior the set defined by the clients arguments." + hasPreviousPage: Boolean! + "When paginating backwards, the cursor to continue." + startCursor: String + "When paginating forwards, the cursor to continue." + endCursor: String +} + type User { name: String! } diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/InferenceTests.Handle_FactoryTypeReference_For_Connection.graphql b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/InferenceTests.Handle_FactoryTypeReference_For_Connection.graphql index 0290f2613f2..8fc2176814f 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/InferenceTests.Handle_FactoryTypeReference_For_Connection.graphql +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/InferenceTests.Handle_FactoryTypeReference_For_Connection.graphql @@ -2,8 +2,19 @@ schema { query: Query1 } -interface ProductBase { - name: String! +type Query1 { + products( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): ProductsConnection + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) + @cost(weight: "10") } "Information about pagination in a connection." @@ -40,19 +51,8 @@ type ProductsEdge { node: ProductBase! } -type Query1 { - products( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): ProductsConnection - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) - @cost(weight: "10") +interface ProductBase { + name: String! } "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/InferenceTests.Handle_FactoryTypeReference_For_Enumerable.graphql b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/InferenceTests.Handle_FactoryTypeReference_For_Enumerable.graphql index 0290f2613f2..8fc2176814f 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/InferenceTests.Handle_FactoryTypeReference_For_Enumerable.graphql +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/InferenceTests.Handle_FactoryTypeReference_For_Enumerable.graphql @@ -2,8 +2,19 @@ schema { query: Query1 } -interface ProductBase { - name: String! +type Query1 { + products( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): ProductsConnection + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) + @cost(weight: "10") } "Information about pagination in a connection." @@ -40,19 +51,8 @@ type ProductsEdge { node: ProductBase! } -type Query1 { - products( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): ProductsConnection - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) - @cost(weight: "10") +interface ProductBase { + name: String! } "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Attribute_Interface_With_Paging_Field.graphql b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Attribute_Interface_With_Paging_Field.graphql index 8841f9c1137..ef3f3f6c9e2 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Attribute_Interface_With_Paging_Field.graphql +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Attribute_Interface_With_Paging_Field.graphql @@ -2,7 +2,27 @@ schema { query: QueryAttr } -interface ISome2 { +type QueryAttr { + nestedObjectList( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): NestedObjectListConnection + letters( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): LettersConnection explicitType( "Returns the first _n_ elements from the list." first: Int @@ -87,27 +107,7 @@ type PageInfo { endCursor: String } -type QueryAttr { - nestedObjectList( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): NestedObjectListConnection - letters( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): LettersConnection +interface ISome2 { explicitType( "Returns the first _n_ elements from the list." first: Int diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Attribute_Simple_StringList_Schema.graphql b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Attribute_Simple_StringList_Schema.graphql index 0ac66a80e5d..622719176be 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Attribute_Simple_StringList_Schema.graphql +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Attribute_Simple_StringList_Schema.graphql @@ -2,6 +2,39 @@ schema { query: QueryAttr } +type QueryAttr { + nestedObjectList( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): NestedObjectListConnection + letters( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): LettersConnection + explicitType( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): ExplicitTypeConnection +} + "A connection to a list of items." type ExplicitTypeConnection { "Information to aid in pagination." @@ -73,36 +106,3 @@ type PageInfo { "When paginating forwards, the cursor to continue." endCursor: String } - -type QueryAttr { - nestedObjectList( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): NestedObjectListConnection - letters( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): LettersConnection - explicitType( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): ExplicitTypeConnection -} diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Deactivate_BackwardPagination.graphql b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Deactivate_BackwardPagination.graphql index 7aa383cc642..00ed35e1255 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Deactivate_BackwardPagination.graphql +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Deactivate_BackwardPagination.graphql @@ -2,6 +2,39 @@ schema { query: Query } +type Query { + letters( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + ): LettersConnection + explicitType( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + ): ExplicitTypeConnection + nestedObjectList( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + ): NestedObjectListConnection + extendedTypeRef( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + ): ExtendedTypeRefConnection + extendedTypeRefNested( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + ): ExtendedTypeRefNestedConnection +} + "A connection to a list of items." type ExplicitTypeConnection { "Information to aid in pagination." @@ -109,36 +142,3 @@ type PageInfo { "When paginating forwards, the cursor to continue." endCursor: String } - -type Query { - letters( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - ): LettersConnection - explicitType( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - ): ExplicitTypeConnection - nestedObjectList( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - ): NestedObjectListConnection - extendedTypeRef( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - ): ExtendedTypeRefConnection - extendedTypeRefNested( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - ): ExtendedTypeRefNestedConnection -} diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Deactivate_BackwardPagination_Interface.graphql b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Deactivate_BackwardPagination_Interface.graphql index 3bc82bbb050..98b82955292 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Deactivate_BackwardPagination_Interface.graphql +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Deactivate_BackwardPagination_Interface.graphql @@ -2,7 +2,19 @@ schema { query: QueryAttr } -interface ISome { +type QueryAttr { + nestedObjectList( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + ): NestedObjectListConnection + letters( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + ): LettersConnection explicitType( "Returns the first _n_ elements from the list." first: Int @@ -83,19 +95,7 @@ type PageInfo { endCursor: String } -type QueryAttr { - nestedObjectList( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - ): NestedObjectListConnection - letters( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - ): LettersConnection +interface ISome { explicitType( "Returns the first _n_ elements from the list." first: Int diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Explicit_ConnectionName.graphql b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Explicit_ConnectionName.graphql index ea4863550d9..f50d50d8e55 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Explicit_ConnectionName.graphql +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Explicit_ConnectionName.graphql @@ -2,6 +2,39 @@ schema { query: ExplicitConnectionName } +type ExplicitConnectionName { + abc( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): Connection1Connection + def( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): Connection2Connection + ghi( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): GhiConnection +} + "A connection to a list of items." type Connection1Connection { "Information to aid in pagination." @@ -38,39 +71,6 @@ type Connection2Edge { node: String! } -type ExplicitConnectionName { - abc( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): Connection1Connection - def( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): Connection2Connection - ghi( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): GhiConnection -} - "A connection to a list of items." type GhiConnection { "Information to aid in pagination." diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Explicit_ConnectionName_With_NamingConvention.graphql b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Explicit_ConnectionName_With_NamingConvention.graphql index 9ab0e8702d4..92401b8aabc 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Explicit_ConnectionName_With_NamingConvention.graphql +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Explicit_ConnectionName_With_NamingConvention.graphql @@ -2,6 +2,39 @@ schema { query: ExplicitConnectionName } +type ExplicitConnectionName { + abc( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): Connection1ConnectionNamed + def( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): Connection2ConnectionNamed + ghi( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): GhiConnectionNamed +} + "A connection to a list of items." type Connection1ConnectionNamed { "Information to aid in pagination." @@ -38,39 +71,6 @@ type Connection2EdgeNamed { node: String! } -type ExplicitConnectionName { - abc( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): Connection1ConnectionNamed - def( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): Connection2ConnectionNamed - ghi( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): GhiConnectionNamed -} - "A connection to a list of items." type GhiConnectionNamed { "Information to aid in pagination." diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.IncludeNodesField_False.graphql b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.IncludeNodesField_False.graphql index cd20918624b..5391ff3b5f7 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.IncludeNodesField_False.graphql +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.IncludeNodesField_False.graphql @@ -2,6 +2,59 @@ schema { query: Query } +type Query { + letters( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): LettersConnection + explicitType( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): ExplicitTypeConnection + nestedObjectList( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): NestedObjectListConnection + extendedTypeRef( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): ExtendedTypeRefConnection + extendedTypeRefNested( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): ExtendedTypeRefNestedConnection +} + "A connection to a list of items." type ExplicitTypeConnection { "Information to aid in pagination." @@ -99,56 +152,3 @@ type PageInfo { "When paginating forwards, the cursor to continue." endCursor: String } - -type Query { - letters( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): LettersConnection - explicitType( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): ExplicitTypeConnection - nestedObjectList( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): NestedObjectListConnection - extendedTypeRef( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): ExtendedTypeRefConnection - extendedTypeRefNested( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): ExtendedTypeRefNestedConnection -} diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Interface_With_Paging_Field.graphql b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Interface_With_Paging_Field.graphql index 2a6a75e2e33..066b69bf16e 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Interface_With_Paging_Field.graphql +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Interface_With_Paging_Field.graphql @@ -2,7 +2,27 @@ schema { query: QueryAttr } -interface ISome { +type QueryAttr { + nestedObjectList( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): NestedObjectListConnection + letters( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): LettersConnection explicitType( "Returns the first _n_ elements from the list." first: Int @@ -87,27 +107,7 @@ type PageInfo { endCursor: String } -type QueryAttr { - nestedObjectList( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): NestedObjectListConnection - letters( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): LettersConnection +interface ISome { explicitType( "Returns the first _n_ elements from the list." first: Int diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Simple_StringList_Schema.graphql b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Simple_StringList_Schema.graphql index 1752103e18b..b78c6ae7e6e 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Simple_StringList_Schema.graphql +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/IntegrationTests.Simple_StringList_Schema.graphql @@ -2,6 +2,59 @@ schema { query: Query } +type Query { + letters( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): LettersConnection + explicitType( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): ExplicitTypeConnection + nestedObjectList( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): NestedObjectListConnection + extendedTypeRef( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): ExtendedTypeRefConnection + extendedTypeRefNested( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): ExtendedTypeRefNestedConnection +} + "A connection to a list of items." type ExplicitTypeConnection { "Information to aid in pagination." @@ -109,56 +162,3 @@ type PageInfo { "When paginating forwards, the cursor to continue." endCursor: String } - -type Query { - letters( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): LettersConnection - explicitType( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): ExplicitTypeConnection - nestedObjectList( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): NestedObjectListConnection - extendedTypeRef( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): ExtendedTypeRefConnection - extendedTypeRefNested( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): ExtendedTypeRefNestedConnection -} diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.Ensure_Attributes_Are_Applied_Once.snap b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.Ensure_Attributes_Are_Applied_Once.snap index d9bc9ac25d9..56d48525b08 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.Ensure_Attributes_Are_Applied_Once.snap +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.Ensure_Attributes_Are_Applied_Once.snap @@ -2,8 +2,17 @@ schema { query: Query1 } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { +type Query1 implements Node { + foos( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): FoosConnection id: ID! } @@ -41,16 +50,7 @@ type PageInfo { endCursor: String } -type Query1 implements Node { - foos( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): FoosConnection +"The node interface is implemented by entities that have a global unique identifier." +interface Node { id: ID! } diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.UsePagingAttribute_Infer_Types.snap b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.UsePagingAttribute_Infer_Types.snap index cc20fe6c54e..6456b337e1a 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.UsePagingAttribute_Infer_Types.snap +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.UsePagingAttribute_Infer_Types.snap @@ -2,6 +2,19 @@ schema { query: Query } +type Query { + foos( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): FoosConnection +} + type Foo { bar: String! } @@ -35,16 +48,3 @@ type PageInfo { "When paginating forwards, the cursor to continue." endCursor: String } - -type Query { - foos( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): FoosConnection -} diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.UsePagingAttribute_Infer_Types_On_Interface.snap b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.UsePagingAttribute_Infer_Types_On_Interface.snap index f86752510e5..c1784c06aec 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.UsePagingAttribute_Infer_Types_On_Interface.snap +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.UsePagingAttribute_Infer_Types_On_Interface.snap @@ -1,16 +1,3 @@ -interface IHasFoos { - foos( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): FoosConnection -} - type Foo { bar: String! } @@ -44,3 +31,16 @@ type PageInfo { "When paginating forwards, the cursor to continue." endCursor: String } + +interface IHasFoos { + foos( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): FoosConnection +} diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.UsePagingAttribute_On_Extension_Infer_Types.snap b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.UsePagingAttribute_On_Extension_Infer_Types.snap index cc20fe6c54e..6456b337e1a 100644 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.UsePagingAttribute_On_Extension_Infer_Types.snap +++ b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/__snapshots__/UsePagingAttributeTests.UsePagingAttribute_On_Extension_Infer_Types.snap @@ -2,6 +2,19 @@ schema { query: Query } +type Query { + foos( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): FoosConnection +} + type Foo { bar: String! } @@ -35,16 +48,3 @@ type PageInfo { "When paginating forwards, the cursor to continue." endCursor: String } - -type Query { - foos( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): FoosConnection -} diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.InferErrorEvenIfExplicitFieldBindingIsUsed.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.InferErrorEvenIfExplicitFieldBindingIsUsed.snap index bb6f894e883..9bd0686f2a0 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.InferErrorEvenIfExplicitFieldBindingIsUsed.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.InferErrorEvenIfExplicitFieldBindingIsUsed.snap @@ -3,8 +3,12 @@ schema { mutation: ExplicitMutation } -interface Error { - message: String! +type Query { + abc: String +} + +type ExplicitMutation { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type DoSomethingPayload { @@ -16,12 +20,8 @@ type ExplicitCustomError implements Error { message: String! } -type ExplicitMutation { - doSomething(input: DoSomethingInput!): DoSomethingPayload! -} - -type Query { - abc: String +interface Error { + message: String! } union DoSomethingError = ExplicitCustomError diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.List_Return_Type.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.List_Return_Type.graphql index 6f3cfb88731..87d74ac0662 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.List_Return_Type.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.List_Return_Type.graphql @@ -3,16 +3,16 @@ schema { mutation: ListReturnMutation } -type AddItemPayload { - resultItem: [ResultItem!] +type Query { + abc: String } type ListReturnMutation { addItem(input: AddItemInput!): AddItemPayload! } -type Query { - abc: String +type AddItemPayload { + resultItem: [ResultItem!] } type ResultItem { diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.MultipleArgumentMutation_Inferred.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.MultipleArgumentMutation_Inferred.graphql index 15dcf82caa1..f7ac539902c 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.MultipleArgumentMutation_Inferred.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.MultipleArgumentMutation_Inferred.graphql @@ -2,14 +2,14 @@ schema { mutation: MultipleArgumentMutation } -type DoSomethingPayload { - string: String -} - type MultipleArgumentMutation { doSomething(input: DoSomethingInput!): DoSomethingPayload! } +type DoSomethingPayload { + string: String +} + input DoSomethingInput { something1: String! something2: String! diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.MutationConvention_With_SnakeCase_ObjectField_NamingConvention_Uses_PascalCase_TypeNames.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.MutationConvention_With_SnakeCase_ObjectField_NamingConvention_Uses_PascalCase_TypeNames.graphql index f84a94f5d3e..1aa9561e1ff 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.MutationConvention_With_SnakeCase_ObjectField_NamingConvention_Uses_PascalCase_TypeNames.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.MutationConvention_With_SnakeCase_ObjectField_NamingConvention_Uses_PascalCase_TypeNames.graphql @@ -2,14 +2,14 @@ schema { mutation: Issue4803Mutation } -type DoSomethingPayload { - issue4803_result: Issue4803Result -} - type Issue4803Mutation { do_something(input: DoSomethingInput!): DoSomethingPayload! } +type DoSomethingPayload { + issue4803_result: Issue4803Result +} + type Issue4803Result { user_name: String! } diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Mutation_With_ErrorAnnotatedAndCustomInterface.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Mutation_With_ErrorAnnotatedAndCustomInterface.snap index 656427fe2ab..4cc586192b0 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Mutation_With_ErrorAnnotatedAndCustomInterface.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Mutation_With_ErrorAnnotatedAndCustomInterface.snap @@ -3,16 +3,12 @@ schema { mutation: MutationWithErrorInterface } -interface IErrorInterface { - message: String! -} - -interface IInterfaceError { - name: String! +type Query { + abc: String } -interface IInterfaceError2 { - name: String! +type MutationWithErrorInterface { + annotated(input: AnnotatedInput!): AnnotatedPayload! } type AnnotatedPayload { @@ -30,12 +26,16 @@ type ErrorAnnotatedAndNot implements IErrorInterface & IInterfaceError2 { name: String! } -type MutationWithErrorInterface { - annotated(input: AnnotatedInput!): AnnotatedPayload! +interface IErrorInterface { + message: String! } -type Query { - abc: String +interface IInterfaceError { + name: String! +} + +interface IInterfaceError2 { + name: String! } union AnnotatedError = ErrorAnnotated | ErrorAnnotatedAndNot diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Mutation_With_ErrorAnnotatedAndCustomInterface_LateAndEarlyRegistration.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Mutation_With_ErrorAnnotatedAndCustomInterface_LateAndEarlyRegistration.snap index e34b32a5fe5..a404f8c7202 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Mutation_With_ErrorAnnotatedAndCustomInterface_LateAndEarlyRegistration.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Mutation_With_ErrorAnnotatedAndCustomInterface_LateAndEarlyRegistration.snap @@ -3,16 +3,13 @@ schema { mutation: MutationWithErrorInterface2 } -interface IErrorInterface { - message: String! -} - -interface IInterfaceError { - name: String! +type Query { + abc: String } -interface IInterfaceError2 { - name: String! +type MutationWithErrorInterface2 { + annotated(input: AnnotatedInput!): AnnotatedPayload! + exampleResult(input: ExampleResultInput!): ExampleResultPayload! } type AnnotatedPayload { @@ -43,13 +40,16 @@ type ExampleResultPayload { exampleResult: ExampleResult } -type MutationWithErrorInterface2 { - annotated(input: AnnotatedInput!): AnnotatedPayload! - exampleResult(input: ExampleResultInput!): ExampleResultPayload! +interface IErrorInterface { + message: String! } -type Query { - abc: String +interface IInterfaceError { + name: String! +} + +interface IInterfaceError2 { + name: String! } union AnnotatedError = ErrorAnnotated | ErrorAnnotatedAndNot diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Mutation_With_ErrorWithInterface.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Mutation_With_ErrorWithInterface.snap index d2bf512a27a..408251a80f8 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Mutation_With_ErrorWithInterface.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Mutation_With_ErrorWithInterface.snap @@ -3,16 +3,12 @@ schema { mutation: MutationWithInterfaces } -interface Error { - message: String! -} - -interface IInterfaceError { - name: String! +type Query { + abc: String } -interface IInterfaceError2 { - name: String! +type MutationWithInterfaces { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type DoSomethingPayload { @@ -25,12 +21,16 @@ type ErrorWithInterface implements Error & IInterfaceError & IInterfaceError2 { message: String! } -type MutationWithInterfaces { - doSomething(input: DoSomethingInput!): DoSomethingPayload! +interface Error { + message: String! } -type Query { - abc: String +interface IInterfaceError { + name: String! +} + +interface IInterfaceError2 { + name: String! } union DoSomethingError = ErrorWithInterface diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Payload_Override_With_Errors.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Payload_Override_With_Errors.graphql index 4b447cb45e8..2aa4d630466 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Payload_Override_With_Errors.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Payload_Override_With_Errors.graphql @@ -2,8 +2,8 @@ schema { mutation: MutationWithPayloadOverride } -interface Error { - message: String! +type MutationWithPayloadOverride { + doSomething2(input: DoSomething2Input!): DoSomething2Payload! } type Custom2Error implements Error { @@ -19,8 +19,8 @@ type DoSomething2Payload { errors: [DoSomething2Error!] } -type MutationWithPayloadOverride { - doSomething2(input: DoSomething2Input!): DoSomething2Payload! +interface Error { + message: String! } union DoSomething2Error = CustomError | Custom2Error diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Query_Filed_Stays_NonNull.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Query_Filed_Stays_NonNull.graphql index 48bdbb821cd..4da62902e61 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Query_Filed_Stays_NonNull.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Query_Filed_Stays_NonNull.graphql @@ -3,8 +3,12 @@ schema { mutation: MutationWithPayloadOverride } -interface Error { - message: String! +type Query { + abc: String +} + +type MutationWithPayloadOverride { + doSomething2(input: DoSomething2Input!): DoSomething2Payload! } type Custom2Error implements Error { @@ -21,12 +25,8 @@ type DoSomething2Payload { query: Query! } -type MutationWithPayloadOverride { - doSomething2(input: DoSomething2Input!): DoSomething2Payload! -} - -type Query { - abc: String +interface Error { + message: String! } union DoSomething2Error = CustomError | Custom2Error diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutationExtension_Inferred.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutationExtension_Inferred.graphql index 2b4cc0fd0bd..48e78fcc415 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutationExtension_Inferred.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutationExtension_Inferred.graphql @@ -2,14 +2,14 @@ schema { mutation: Mutation } -type DoSomethingPayload { - string: String -} - type Mutation { doSomething(input: DoSomethingInput!): DoSomethingPayload! } +type DoSomethingPayload { + string: String +} + input DoSomethingInput { something: String! } diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutationReturnList_Inferred.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutationReturnList_Inferred.graphql index 7b340d3c7c1..68c70163ef9 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutationReturnList_Inferred.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutationReturnList_Inferred.graphql @@ -2,14 +2,14 @@ schema { mutation: SimpleMutationReturnList } -type DoSomethingPayload { - string: [String!] -} - type SimpleMutationReturnList { doSomething(input: DoSomethingInput!): DoSomethingPayload! } +type DoSomethingPayload { + string: [String!] +} + input DoSomethingInput { something: String! } diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Add_Error_Via_Type_Interceptor.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Add_Error_Via_Type_Interceptor.graphql index 8674c4349f4..0cefe105ce5 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Add_Error_Via_Type_Interceptor.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Add_Error_Via_Type_Interceptor.graphql @@ -2,8 +2,8 @@ schema { mutation: SimpleMutationInputOverride } -interface Error { - message: String! +type SimpleMutationInputOverride { + doSomething(something: DoSomethingInput!): DoSomethingPayload! } type DoSomethingPayload { @@ -15,8 +15,8 @@ type OutOfMemoryError implements Error { message: String! } -type SimpleMutationInputOverride { - doSomething(something: DoSomethingInput!): DoSomethingPayload! +interface Error { + message: String! } union DoSomethingError = OutOfMemoryError diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Attribute.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Attribute.graphql index fe90fed10a8..a892c68eb91 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Attribute.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Attribute.graphql @@ -2,14 +2,14 @@ schema { mutation: SimpleMutationAttribute } -type PayloadTypeName { - payloadFieldName: String -} - type SimpleMutationAttribute { doSomething(inputArgumentName: InputTypeName!): PayloadTypeName! } +type PayloadTypeName { + payloadFieldName: String +} + input InputTypeName { something: String! } diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred.graphql index 59a63876618..081aad9b818 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred.graphql @@ -2,14 +2,14 @@ schema { mutation: SimpleMutation } -type DoSomethingPayload { - string: String -} - type SimpleMutation { doSomething(input: DoSomethingInput!): DoSomethingPayload! } +type DoSomethingPayload { + string: String +} + input DoSomethingInput { something: String! } diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Attribute.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Attribute.graphql index fe90fed10a8..a892c68eb91 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Attribute.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Attribute.graphql @@ -2,14 +2,14 @@ schema { mutation: SimpleMutationAttribute } -type PayloadTypeName { - payloadFieldName: String -} - type SimpleMutationAttribute { doSomething(inputArgumentName: InputTypeName!): PayloadTypeName! } +type PayloadTypeName { + payloadFieldName: String +} + input InputTypeName { something: String! } diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Defaults.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Defaults.graphql index 32abf5f889c..50288253956 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Defaults.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Defaults.graphql @@ -2,8 +2,8 @@ schema { mutation: SimpleMutationWithSingleError } -interface Error { - message: String! +type SimpleMutationWithSingleError { + doSomething(inputArgument: DoSomethingIn!): DoSomethingOut! } type CustomError implements Error { @@ -15,8 +15,8 @@ type DoSomethingOut { errors: [DoSomethingFault!] } -type SimpleMutationWithSingleError { - doSomething(inputArgument: DoSomethingIn!): DoSomethingOut! +interface Error { + message: String! } union DoSomethingFault = CustomError diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Global_Errors.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Global_Errors.graphql index dfd8966d551..76a8c1e44dc 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Global_Errors.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Global_Errors.graphql @@ -2,8 +2,8 @@ schema { mutation: SimpleMutation } -interface Error { - message: String! +type SimpleMutation { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type DoSomethingPayload { @@ -11,11 +11,11 @@ type DoSomethingPayload { errors: [DoSomethingError!] } -type SimpleMutation { - doSomething(input: DoSomethingInput!): DoSomethingPayload! +type SomeNewError implements Error { + message: String! } -type SomeNewError implements Error { +interface Error { message: String! } diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Query_Field_Stays_NonNull.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Query_Field_Stays_NonNull.graphql index 4ed3e9e9bd8..e76e3b9bc7d 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Query_Field_Stays_NonNull.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_Query_Field_Stays_NonNull.graphql @@ -3,11 +3,6 @@ schema { mutation: SimpleMutation } -type DoSomethingPayload { - string: String - query: Query! -} - type Query { abc: String } @@ -16,6 +11,11 @@ type SimpleMutation { doSomething(input: DoSomethingInput!): DoSomethingPayload! } +type DoSomethingPayload { + string: String + query: Query! +} + input DoSomethingInput { something: String! } diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_ErrorObj.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_ErrorObj.graphql index 8e35b250fee..80984d8e7d7 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_ErrorObj.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_ErrorObj.graphql @@ -2,8 +2,8 @@ schema { mutation: SimpleMutationWithErrorObj } -interface Error { - message: String! +type SimpleMutationWithErrorObj { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type DoSomethingPayload { @@ -11,11 +11,11 @@ type DoSomethingPayload { errors: [DoSomethingError!] } -type SimpleMutationWithErrorObj { - doSomething(input: DoSomethingInput!): DoSomethingPayload! +type SomeNewError implements Error { + message: String! } -type SomeNewError implements Error { +interface Error { message: String! } diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_QueryField.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_QueryField.graphql index 4ed3e9e9bd8..e76e3b9bc7d 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_QueryField.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_QueryField.graphql @@ -3,11 +3,6 @@ schema { mutation: SimpleMutation } -type DoSomethingPayload { - string: String - query: Query! -} - type Query { abc: String } @@ -16,6 +11,11 @@ type SimpleMutation { doSomething(input: DoSomethingInput!): DoSomethingPayload! } +type DoSomethingPayload { + string: String + query: Query! +} + input DoSomethingInput { something: String! } diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_Single_Error.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_Single_Error.graphql index 8059b57885c..968b347d7c0 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_Single_Error.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_Single_Error.graphql @@ -2,8 +2,8 @@ schema { mutation: SimpleMutationWithSingleError } -interface Error { - message: String! +type SimpleMutationWithSingleError { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type CustomError implements Error { @@ -15,8 +15,8 @@ type DoSomethingPayload { errors: [DoSomethingError!] } -type SimpleMutationWithSingleError { - doSomething(input: DoSomethingInput!): DoSomethingPayload! +interface Error { + message: String! } union DoSomethingError = CustomError diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_Single_Error_Query_Field_Stays_Non_Null.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_Single_Error_Query_Field_Stays_Non_Null.graphql index e4b32b598b5..75b9fd2c2af 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_Single_Error_Query_Field_Stays_Non_Null.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_Single_Error_Query_Field_Stays_Non_Null.graphql @@ -3,8 +3,12 @@ schema { mutation: SimpleMutationWithSingleError } -interface Error { - message: String! +type Query { + abc: String +} + +type SimpleMutationWithSingleError { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type CustomError implements Error { @@ -17,12 +21,8 @@ type DoSomethingPayload { query: Query! } -type Query { - abc: String -} - -type SimpleMutationWithSingleError { - doSomething(input: DoSomethingInput!): DoSomethingPayload! +interface Error { + message: String! } union DoSomethingError = CustomError diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_Two_Errors.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_Two_Errors.graphql index e107d2041b7..dadb53fc061 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_Two_Errors.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Inferred_With_Two_Errors.graphql @@ -2,8 +2,8 @@ schema { mutation: SimpleMutationWithTwoErrors } -interface Error { - message: String! +type SimpleMutationWithTwoErrors { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type Custom2Error implements Error { @@ -19,8 +19,8 @@ type DoSomethingPayload { errors: [DoSomethingError!] } -type SimpleMutationWithTwoErrors { - doSomething(input: DoSomethingInput!): DoSomethingPayload! +interface Error { + message: String! } union DoSomethingError = CustomError | Custom2Error diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Override_Input.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Override_Input.graphql index d522a9fe516..b9faaefc322 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Override_Input.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Override_Input.graphql @@ -2,14 +2,14 @@ schema { mutation: SimpleMutationInputOverride } -type DoSomethingPayload { - string: String -} - type SimpleMutationInputOverride { doSomething(something: DoSomethingInput!): DoSomethingPayload! } +type DoSomethingPayload { + string: String +} + input DoSomethingInput { myInput1: String! myInput2: String! diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Override_Payload.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Override_Payload.graphql index 5c408d44a6e..9971bd595dd 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Override_Payload.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Override_Payload.graphql @@ -2,15 +2,15 @@ schema { mutation: SimpleMutationPayloadOverride } +type SimpleMutationPayloadOverride { + doSomething(input: DoSomethingInput!): DoSomethingPayload! +} + type DoSomethingPayload { myResult1: String! myResult2: String! } -type SimpleMutationPayloadOverride { - doSomething(input: DoSomethingInput!): DoSomethingPayload! -} - input DoSomethingInput { something: String! } diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Override_Payload_WithError.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Override_Payload_WithError.graphql index 7ac4d4a2028..27f1c960865 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Override_Payload_WithError.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.SimpleMutation_Override_Payload_WithError.graphql @@ -2,8 +2,8 @@ schema { mutation: SimpleMutationPayloadOverrideWithError } -interface Error { - message: String! +type SimpleMutationPayloadOverrideWithError { + doSomething: DoSomethingPayload! } type CustomError implements Error { @@ -16,8 +16,8 @@ type DoSomethingPayload { errors: [DoSomethingError!] } -type SimpleMutationPayloadOverrideWithError { - doSomething: DoSomethingPayload! +interface Error { + message: String! } union DoSomethingError = CustomError diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_1_Schema.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_1_Schema.graphql index a05e3932211..ba864ea3d8b 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_1_Schema.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_1_Schema.graphql @@ -2,8 +2,8 @@ schema { mutation: MutationWithUnionResult1 } -interface Error { - message: String! +type MutationWithUnionResult1 { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type Custom2Error implements Error { @@ -19,8 +19,8 @@ type DoSomethingPayload { errors: [DoSomethingError!] } -type MutationWithUnionResult1 { - doSomething(input: DoSomethingInput!): DoSomethingPayload! +interface Error { + message: String! } union DoSomethingError = CustomError | Custom2Error diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_2_Schema.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_2_Schema.graphql index 80f828d7e31..d2c94b33897 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_2_Schema.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_2_Schema.graphql @@ -2,8 +2,8 @@ schema { mutation: MutationWithUnionResult2 } -interface Error { - message: String! +type MutationWithUnionResult2 { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type Custom2Error implements Error { @@ -15,8 +15,8 @@ type DoSomethingPayload { errors: [DoSomethingError!] } -type MutationWithUnionResult2 { - doSomething(input: DoSomethingInput!): DoSomethingPayload! +interface Error { + message: String! } union DoSomethingError = Custom2Error diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_2_Task_Schema.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_2_Task_Schema.graphql index fe6b4f31c83..45082066204 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_2_Task_Schema.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_2_Task_Schema.graphql @@ -2,8 +2,8 @@ schema { mutation: Mutation } -interface Error { - message: String! +type Mutation { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type Custom2Error implements Error { @@ -15,8 +15,8 @@ type DoSomethingPayload { errors: [DoSomethingError!] } -type Mutation { - doSomething(input: DoSomethingInput!): DoSomethingPayload! +interface Error { + message: String! } union DoSomethingError = Custom2Error diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_3_Schema.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_3_Schema.graphql index d25e831e037..a298e705d52 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_3_Schema.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_3_Schema.graphql @@ -2,8 +2,8 @@ schema { mutation: MutationWithUnionResult3 } -interface Error { - message: String! +type MutationWithUnionResult3 { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type Custom2Error implements Error { @@ -19,8 +19,8 @@ type DoSomethingPayload { errors: [DoSomethingError!] } -type MutationWithUnionResult3 { - doSomething(input: DoSomethingInput!): DoSomethingPayload! +interface Error { + message: String! } union DoSomethingError = CustomError | Custom2Error diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_4_Schema.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_4_Schema.graphql index d7952d9c507..ef9fa99135a 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_4_Schema.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_4_Schema.graphql @@ -2,8 +2,8 @@ schema { mutation: MutationWithUnionResult4 } -interface Error { - message: String! +type MutationWithUnionResult4 { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type Custom2Error implements Error { @@ -23,8 +23,8 @@ type DoSomethingPayload { errors: [DoSomethingError!] } -type MutationWithUnionResult4 { - doSomething(input: DoSomethingInput!): DoSomethingPayload! +interface Error { + message: String! } union DoSomethingError = CustomError | Custom2Error | Custom3Error diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_5_Schema.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_5_Schema.graphql index 3ac86aabe71..14df44b6339 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_5_Schema.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_5_Schema.graphql @@ -2,8 +2,8 @@ schema { mutation: MutationWithUnionResult5 } -interface Error { - message: String! +type MutationWithUnionResult5 { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type Custom2Error implements Error { @@ -23,8 +23,8 @@ type DoSomethingPayload { errors: [DoSomethingError!] } -type MutationWithUnionResult5 { - doSomething(input: DoSomethingInput!): DoSomethingPayload! +interface Error { + message: String! } union DoSomethingError = CustomError | Custom2Error | Custom4Error diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_6_Schema.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_6_Schema.graphql index 941658ddb17..e5b9fb23a9c 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_6_Schema.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_6_Schema.graphql @@ -2,8 +2,8 @@ schema { mutation: MutationWithUnionResult6 } -interface Error { - message: String! +type MutationWithUnionResult6 { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type Custom2Error implements Error { @@ -27,8 +27,8 @@ type DoSomethingPayload { errors: [DoSomethingError!] } -type MutationWithUnionResult6 { - doSomething(input: DoSomethingInput!): DoSomethingPayload! +interface Error { + message: String! } union DoSomethingError = CustomError | Custom2Error | Custom4Error | Custom5 diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_7_Schema.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_7_Schema.graphql index 96bf88b765a..6bbd2ce59ba 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_7_Schema.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/AnnotationBasedMutations.Union_Result_7_Schema.graphql @@ -2,8 +2,8 @@ schema { mutation: MutationWithUnionResult7 } -interface Error { - message: String! +type MutationWithUnionResult7 { + doSomething(input: DoSomethingInput!): DoSomethingPayload! } type Custom2Error implements Error { @@ -31,8 +31,8 @@ type DoSomethingPayload { errors: [DoSomethingError!] } -type MutationWithUnionResult7 { - doSomething(input: DoSomethingInput!): DoSomethingPayload! +interface Error { + message: String! } union DoSomethingError = CustomError | Custom2Error | Custom4Error | Custom5 | Custom6 diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/CodeFirstMutations.SimpleMutation_Inferred.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/CodeFirstMutations.SimpleMutation_Inferred.graphql index 2f1e092c919..df54772b710 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/CodeFirstMutations.SimpleMutation_Inferred.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/CodeFirstMutations.SimpleMutation_Inferred.graphql @@ -2,14 +2,14 @@ schema { mutation: Mutation } -type DoSomethingPayload { - string: String -} - type Mutation { doSomething(input: DoSomethingInput!): DoSomethingPayload! } +type DoSomethingPayload { + string: String +} + input DoSomethingInput { a: String } diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_AllowToCustomizeErrorInterfaceRuntimeType.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_AllowToCustomizeErrorInterfaceRuntimeType.snap index 43679882d68..8b89fdd9512 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_AllowToCustomizeErrorInterfaceRuntimeType.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_AllowToCustomizeErrorInterfaceRuntimeType.snap @@ -21,9 +21,8 @@ schema { mutation: Mutation } -interface IUserError { - message: String - code: String +type Mutation { + throw: ThrowPayload! } type CustomInterfaceError implements IUserError { @@ -31,10 +30,6 @@ type CustomInterfaceError implements IUserError { code: String! } -type Mutation { - throw: ThrowPayload! -} - type Payload { foo: String! } @@ -44,5 +39,10 @@ type ThrowPayload { errors: [ThrowError!] } +interface IUserError { + message: String + code: String +} + union ThrowError = CustomInterfaceError --------------- diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_AllowToCustomizeErrorInterfaceType.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_AllowToCustomizeErrorInterfaceType.snap index 349a98d2ef9..45db85c1a73 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_AllowToCustomizeErrorInterfaceType.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_AllowToCustomizeErrorInterfaceType.snap @@ -21,9 +21,8 @@ schema { mutation: Mutation } -interface UserError { - message: String! - code: String! +type Mutation { + throw: ThrowPayload! } type CustomInterfaceError implements UserError { @@ -31,10 +30,6 @@ type CustomInterfaceError implements UserError { code: String! } -type Mutation { - throw: ThrowPayload! -} - type Payload { foo: String! } @@ -44,5 +39,10 @@ type ThrowPayload { errors: [ThrowError!] } +interface UserError { + message: String! + code: String! +} + union ThrowError = CustomInterfaceError --------------- diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_CatchCustomerException_WhenRegistered.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_CatchCustomerException_WhenRegistered.snap index ebe01dae3db..128cc1561a3 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_CatchCustomerException_WhenRegistered.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_CatchCustomerException_WhenRegistered.snap @@ -20,18 +20,14 @@ schema { mutation: Mutation } -interface Error { - message: String! +type Mutation { + throw: ThrowPayload! } type CustomError implements Error { message: String! } -type Mutation { - throw: ThrowPayload! -} - type Payload { foo: String! } @@ -41,5 +37,9 @@ type ThrowPayload { errors: [ThrowError!] } +interface Error { + message: String! +} + union ThrowError = CustomError --------------- diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_CatchException_WhenRegistered.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_CatchException_WhenRegistered.snap index de2ac205dac..d2b130f9ab3 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_CatchException_WhenRegistered.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_CatchException_WhenRegistered.snap @@ -20,18 +20,14 @@ schema { mutation: Mutation } -interface Error { - message: String! +type Mutation { + throw: ThrowPayload! } type InvalidOperationError implements Error { message: String! } -type Mutation { - throw: ThrowPayload! -} - type Payload { foo: String! } @@ -41,5 +37,9 @@ type ThrowPayload { errors: [ThrowError!] } +interface Error { + message: String! +} + union ThrowError = InvalidOperationError --------------- diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapAggregateException_WhenRegistered.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapAggregateException_WhenRegistered.snap index 8ce3a6bf64d..7ccc4641e60 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapAggregateException_WhenRegistered.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapAggregateException_WhenRegistered.snap @@ -28,8 +28,8 @@ schema { mutation: Mutation } -interface Error { - message: String! +type Mutation { + throw: ThrowPayload! } type ArgumentError implements Error { @@ -45,10 +45,6 @@ type CustomNullRef implements Error { message: String! } -type Mutation { - throw: ThrowPayload! -} - type Payload { foo: String! } @@ -58,5 +54,9 @@ type ThrowPayload { errors: [ThrowError!] } +interface Error { + message: String! +} + union ThrowError = CustomError | CustomNullRef | ArgumentError --------------- diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapException_WhenRegistered.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapException_WhenRegistered.snap index 5a8de6ab91c..6eac099a425 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapException_WhenRegistered.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapException_WhenRegistered.snap @@ -20,18 +20,14 @@ schema { mutation: Mutation } -interface Error { - message: String! +type Mutation { + throw: ThrowPayload! } type CustomError implements Error { message: String! } -type Mutation { - throw: ThrowPayload! -} - type Payload { foo: String! } @@ -41,5 +37,9 @@ type ThrowPayload { errors: [ThrowError!] } +interface Error { + message: String! +} + union ThrowError = CustomError --------------- diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapFactoryMethodException_WhenRegistered.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapFactoryMethodException_WhenRegistered.snap index 042e21bdd42..f942df3f538 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapFactoryMethodException_WhenRegistered.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapFactoryMethodException_WhenRegistered.snap @@ -20,18 +20,14 @@ schema { mutation: Mutation } -interface Error { - message: String! +type Mutation { + throw: ThrowPayload! } type CustomErrorWithFactory implements Error { message: String! } -type Mutation { - throw: ThrowPayload! -} - type Payload { foo: String! } @@ -41,5 +37,9 @@ type ThrowPayload { errors: [ThrowError!] } +interface Error { + message: String! +} + union ThrowError = CustomErrorWithFactory --------------- diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactoriesOfDifferentType_FirstEx.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactoriesOfDifferentType_FirstEx.snap index 6082d2e4513..f44e0deffbc 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactoriesOfDifferentType_FirstEx.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactoriesOfDifferentType_FirstEx.snap @@ -20,8 +20,8 @@ schema { mutation: Mutation } -interface Error { - message: String! +type Mutation { + throw: ThrowPayload! } type CustomError implements Error { @@ -32,10 +32,6 @@ type CustomNullRef implements Error { message: String! } -type Mutation { - throw: ThrowPayload! -} - type Payload { foo: String! } @@ -45,5 +41,9 @@ type ThrowPayload { errors: [ThrowError!] } +interface Error { + message: String! +} + union ThrowError = CustomError | CustomNullRef --------------- diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactoriesOfDifferentType_SecondEx.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactoriesOfDifferentType_SecondEx.snap index d02294fdf1e..882655ad7c1 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactoriesOfDifferentType_SecondEx.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactoriesOfDifferentType_SecondEx.snap @@ -20,8 +20,8 @@ schema { mutation: Mutation } -interface Error { - message: String! +type Mutation { + throw: ThrowPayload! } type CustomError implements Error { @@ -32,10 +32,6 @@ type CustomNullRef implements Error { message: String! } -type Mutation { - throw: ThrowPayload! -} - type Payload { foo: String! } @@ -45,5 +41,9 @@ type ThrowPayload { errors: [ThrowError!] } +interface Error { + message: String! +} + union ThrowError = CustomError | CustomNullRef --------------- diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactories_When_InterfaceIsUsed.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactories_When_InterfaceIsUsed.snap index d02294fdf1e..882655ad7c1 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactories_When_InterfaceIsUsed.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactories_When_InterfaceIsUsed.snap @@ -20,8 +20,8 @@ schema { mutation: Mutation } -interface Error { - message: String! +type Mutation { + throw: ThrowPayload! } type CustomError implements Error { @@ -32,10 +32,6 @@ type CustomNullRef implements Error { message: String! } -type Mutation { - throw: ThrowPayload! -} - type Payload { foo: String! } @@ -45,5 +41,9 @@ type ThrowPayload { errors: [ThrowError!] } +interface Error { + message: String! +} + union ThrowError = CustomError | CustomNullRef --------------- diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactories_When_NotStatic.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactories_When_NotStatic.snap index d02294fdf1e..882655ad7c1 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactories_When_NotStatic.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactories_When_NotStatic.snap @@ -20,8 +20,8 @@ schema { mutation: Mutation } -interface Error { - message: String! +type Mutation { + throw: ThrowPayload! } type CustomError implements Error { @@ -32,10 +32,6 @@ type CustomNullRef implements Error { message: String! } -type Mutation { - throw: ThrowPayload! -} - type Payload { foo: String! } @@ -45,5 +41,9 @@ type ThrowPayload { errors: [ThrowError!] } +interface Error { + message: String! +} + union ThrowError = CustomError | CustomNullRef --------------- diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactoryMethodException_WhenRegistered.snap b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactoryMethodException_WhenRegistered.snap index e44b6577aff..7945301c9e5 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactoryMethodException_WhenRegistered.snap +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/ErrorMiddlewareTests.ErrorMiddleware_Should_MapMultipleFactoryMethodException_WhenRegistered.snap @@ -20,18 +20,14 @@ schema { mutation: Mutation } -interface Error { - message: String! +type Mutation { + throw: ThrowPayload! } type CustomErrorWithMultipleFactory implements Error { message: String! } -type Mutation { - throw: ThrowPayload! -} - type Payload { foo: String! } @@ -41,5 +37,9 @@ type ThrowPayload { errors: [ThrowError!] } +interface Error { + message: String! +} + union ThrowError = CustomErrorWithMultipleFactory --------------- diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/Issue6605ReproTests.Mutation_Error_Type_With_Int_Field_Should_Not_Fail_Schema_Build.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/Issue6605ReproTests.Mutation_Error_Type_With_Int_Field_Should_Not_Fail_Schema_Build.graphql index 5b256088a69..7b05908449e 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/Issue6605ReproTests.Mutation_Error_Type_With_Int_Field_Should_Not_Fail_Schema_Build.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/Issue6605ReproTests.Mutation_Error_Type_With_Int_Field_Should_Not_Fail_Schema_Build.graphql @@ -3,8 +3,12 @@ schema { mutation: Mutation } -interface Error { - message: String! +type Query { + foo: Foo! +} + +type Mutation { + addFoo: AddFooPayload! } type AddFooPayload { @@ -21,12 +25,8 @@ type Foo { bar: String! } -type Mutation { - addFoo: AddFooPayload! -} - -type Query { - foo: Foo! +interface Error { + message: String! } union AddFooError = CustomError diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/SchemaFirstMutations.SimpleMutation_Inferred.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/SchemaFirstMutations.SimpleMutation_Inferred.graphql index 94c73f2354f..af3968f145a 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/SchemaFirstMutations.SimpleMutation_Inferred.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/SchemaFirstMutations.SimpleMutation_Inferred.graphql @@ -2,14 +2,14 @@ schema { mutation: Mutation } -type DoSomethingPayload { - string: String -} - type Mutation { doSomething(input: DoSomethingInput!): DoSomethingPayload! } +type DoSomethingPayload { + string: String +} + input DoSomethingInput { something: String } diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/SchemaFirstMutations.SimpleMutation_Inferred_FieldOverride.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/SchemaFirstMutations.SimpleMutation_Inferred_FieldOverride.graphql index 23f09c76b02..440a63bbf75 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/SchemaFirstMutations.SimpleMutation_Inferred_FieldOverride.graphql +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/SchemaFirstMutations.SimpleMutation_Inferred_FieldOverride.graphql @@ -2,14 +2,14 @@ schema { mutation: Mutation } -type DoSomethingPayload { - something: String -} - type Mutation { doSomething(input: DoSomethingInput!): DoSomethingPayload! } +type DoSomethingPayload { + something: String +} + input DoSomethingInput { something: String } diff --git a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/CustomCollectionSegmentHandlerTests.Infer_Schema_Correctly_When_CollectionSegment_IsUsed.snap b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/CustomCollectionSegmentHandlerTests.Infer_Schema_Correctly_When_CollectionSegment_IsUsed.snap index 80ba4b7d2a8..90a2212a1a0 100644 --- a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/CustomCollectionSegmentHandlerTests.Infer_Schema_Correctly_When_CollectionSegment_IsUsed.snap +++ b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/CustomCollectionSegmentHandlerTests.Infer_Schema_Correctly_When_CollectionSegment_IsUsed.snap @@ -2,6 +2,10 @@ schema { query: Query } +type Query { + items(skip: Int, take: Int): ItemsCollectionSegment +} + "Information about the offset pagination." type CollectionSegmentInfo { "Indicates whether more items exist following the set defined by the clients arguments." @@ -17,7 +21,3 @@ type ItemsCollectionSegment { "A flattened list of the items." items: [String!] } - -type Query { - items(skip: Int, take: Int): ItemsCollectionSegment -} diff --git a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Attribute_Dictionary_ReturnType_ThrowsSchemaException.graphql b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Attribute_Dictionary_ReturnType_ThrowsSchemaException.graphql index 2bdfb9da281..a3885128268 100644 --- a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Attribute_Dictionary_ReturnType_ThrowsSchemaException.graphql +++ b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Attribute_Dictionary_ReturnType_ThrowsSchemaException.graphql @@ -2,6 +2,10 @@ schema { query: UglyLegacyQuery } +type UglyLegacyQuery { + uglyLegacyResolver(skip: Int, take: Int): UglyLegacyResolverCollectionSegment +} + "Information about the offset pagination." type CollectionSegmentInfo { "Indicates whether more items exist following the set defined by the clients arguments." @@ -15,10 +19,6 @@ type KeyValuePairOfStringAndString { value: String! } -type UglyLegacyQuery { - uglyLegacyResolver(skip: Int, take: Int): UglyLegacyResolverCollectionSegment -} - "A segment of a collection." type UglyLegacyResolverCollectionSegment { "Information to aid in pagination." diff --git a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Attribute_Interface_With_Paging_Field.snap b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Attribute_Interface_With_Paging_Field.snap index 06deffe11dd..6fe9995ed48 100644 --- a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Attribute_Interface_With_Paging_Field.snap +++ b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Attribute_Interface_With_Paging_Field.snap @@ -2,7 +2,9 @@ schema { query: QueryAttr } -interface ISome2 { +type QueryAttr { + nestedObjectList(skip: Int, take: Int): NestedObjectListCollectionSegment + letters(skip: Int, take: Int): LettersCollectionSegment explicitType(skip: Int, take: Int): ExplicitTypeCollectionSegment } @@ -43,8 +45,6 @@ type NestedObjectListCollectionSegment { totalCount: Int! } -type QueryAttr { - nestedObjectList(skip: Int, take: Int): NestedObjectListCollectionSegment - letters(skip: Int, take: Int): LettersCollectionSegment +interface ISome2 { explicitType(skip: Int, take: Int): ExplicitTypeCollectionSegment } diff --git a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Attribute_Simple_StringList_Schema.snap b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Attribute_Simple_StringList_Schema.snap index db7b4760110..4bc2b5f9f85 100644 --- a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Attribute_Simple_StringList_Schema.snap +++ b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Attribute_Simple_StringList_Schema.snap @@ -2,6 +2,12 @@ schema { query: QueryAttr } +type QueryAttr { + nestedObjectList(skip: Int, take: Int): NestedObjectListCollectionSegment + letters(skip: Int, take: Int): LettersCollectionSegment + explicitType(skip: Int, take: Int): ExplicitTypeCollectionSegment +} + "Information about the offset pagination." type CollectionSegmentInfo { "Indicates whether more items exist following the set defined by the clients arguments." @@ -38,9 +44,3 @@ type NestedObjectListCollectionSegment { items: [[Foo!]!] totalCount: Int! } - -type QueryAttr { - nestedObjectList(skip: Int, take: Int): NestedObjectListCollectionSegment - letters(skip: Int, take: Int): LettersCollectionSegment - explicitType(skip: Int, take: Int): ExplicitTypeCollectionSegment -} diff --git a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Interface_With_Paging_Field.snap b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Interface_With_Paging_Field.snap index 246380791f2..29a14f4b92c 100644 --- a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Interface_With_Paging_Field.snap +++ b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Interface_With_Paging_Field.snap @@ -2,8 +2,10 @@ schema { query: QueryAttr } -interface ISome { - explicitType(skip: Int, take: Int): StringCollectionSegment +type QueryAttr { + nestedObjectList(skip: Int, take: Int): NestedObjectListCollectionSegment + letters(skip: Int, take: Int): LettersCollectionSegment + explicitType(skip: Int, take: Int): ExplicitTypeCollectionSegment } "Information about the offset pagination." @@ -43,12 +45,6 @@ type NestedObjectListCollectionSegment { totalCount: Int! } -type QueryAttr { - nestedObjectList(skip: Int, take: Int): NestedObjectListCollectionSegment - letters(skip: Int, take: Int): LettersCollectionSegment - explicitType(skip: Int, take: Int): ExplicitTypeCollectionSegment -} - "A segment of a collection." type StringCollectionSegment { "Information to aid in pagination." @@ -56,3 +52,7 @@ type StringCollectionSegment { "A flattened list of the items." items: [String!] } + +interface ISome { + explicitType(skip: Int, take: Int): StringCollectionSegment +} diff --git a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Simple_StringList_Schema.snap b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Simple_StringList_Schema.snap index 578a6dc2c22..097daa247e8 100644 --- a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Simple_StringList_Schema.snap +++ b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/__snapshots__/IntegrationTests.Simple_StringList_Schema.snap @@ -2,6 +2,14 @@ schema { query: Query } +type Query { + letters(skip: Int, take: Int): LettersCollectionSegment + explicitType(skip: Int, take: Int): ExplicitTypeCollectionSegment + nestedObjectList(skip: Int, take: Int): NestedObjectListCollectionSegment + extendedTypeRef(skip: Int, take: Int): ExtendedTypeRefCollectionSegment + extendedTypeRefNested(skip: Int, take: Int): ExtendedTypeRefNestedCollectionSegment +} + "Information about the offset pagination." type CollectionSegmentInfo { "Indicates whether more items exist following the set defined by the clients arguments." @@ -54,11 +62,3 @@ type NestedObjectListCollectionSegment { items: [[Foo!]!] totalCount: Int! } - -type Query { - letters(skip: Int, take: Int): LettersCollectionSegment - explicitType(skip: Int, take: Int): ExplicitTypeCollectionSegment - nestedObjectList(skip: Int, take: Int): NestedObjectListCollectionSegment - extendedTypeRef(skip: Int, take: Int): ExtendedTypeRefCollectionSegment - extendedTypeRefNested(skip: Int, take: Int): ExtendedTypeRefNestedCollectionSegment -} diff --git a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_Exceptions.graphql b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_Exceptions.graphql index a1125b41630..40af2047beb 100644 --- a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_Exceptions.graphql +++ b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_Exceptions.graphql @@ -2,8 +2,8 @@ schema { query: QueryWithException } -interface Error { - message: String! +type QueryWithException { + userById(id: String!): UserByIdResult! } type Address { @@ -17,10 +17,6 @@ type AddressNotFound implements Error { message: String! } -type QueryWithException { - userById(id: String!): UserByIdResult! -} - type User { id: String! name: String! @@ -32,6 +28,10 @@ type UserNotFoundError implements Error { message: String! } +interface Error { + message: String! +} + union AddressResult = Address | AddressNotFound union UserByIdResult = User | UserNotFoundError diff --git a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_FieldResult.graphql b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_FieldResult.graphql index 100c15b339e..95d33e195a9 100644 --- a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_FieldResult.graphql +++ b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_FieldResult.graphql @@ -2,8 +2,9 @@ schema { query: QueryWithFieldResult } -interface Error { - message: String! +type QueryWithFieldResult { + userById(id: String!): UserByIdResult! + userById2(id: String!): UserById2Result! } type Address { @@ -17,11 +18,6 @@ type AddressNotFound implements Error { message: String! } -type QueryWithFieldResult { - userById(id: String!): UserByIdResult! - userById2(id: String!): UserById2Result! -} - type User { id: String! name: String! @@ -34,6 +30,10 @@ type UserNotFound implements Error { message: String! } +interface Error { + message: String! +} + union AddressResult = Address | AddressNotFound union UserById2Result = User | UserNotFound diff --git a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_FieldResult_And_Exceptions.graphql b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_FieldResult_And_Exceptions.graphql index 9ceeb879451..33af15c6ea5 100644 --- a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_FieldResult_And_Exceptions.graphql +++ b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_FieldResult_And_Exceptions.graphql @@ -2,8 +2,8 @@ schema { query: QueryWithFieldResultAndException } -interface Error { - message: String! +type QueryWithFieldResultAndException { + userById(id: String!): UserByIdResult! } type Address { @@ -21,10 +21,6 @@ type InvalidUserIdError implements Error { message: String! } -type QueryWithFieldResultAndException { - userById(id: String!): UserByIdResult! -} - type User { id: String! name: String! @@ -37,6 +33,10 @@ type UserNotFound implements Error { message: String! } +interface Error { + message: String! +} + union AddressResult = Address | AddressNotFound union UserByIdResult = User | UserNotFound | InvalidUserIdError diff --git a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_FieldResult_And_Paging.graphql b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_FieldResult_And_Paging.graphql index 64edbf11a9b..84ac91356aa 100644 --- a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_FieldResult_And_Paging.graphql +++ b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/AnnotationBasedSchemaTests.Schema_Query_With_FieldResult_And_Paging.graphql @@ -2,33 +2,6 @@ schema { query: QueryWithFieldResultAndPaging } -interface Error { - message: String! -} - -type Address { - id: String! - street: String! - city: String! -} - -type AddressNotFound implements Error { - id: String! - message: String! -} - -"Information about pagination in a connection." -type PageInfo { - "Indicates whether more edges exist following the set defined by the clients arguments." - hasNextPage: Boolean! - "Indicates whether more edges exist prior the set defined by the clients arguments." - hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String - "When paginating forwards, the cursor to continue." - endCursor: String -} - type QueryWithFieldResultAndPaging { users( error: Boolean! = false @@ -56,6 +29,29 @@ type QueryWithFieldResultAndPaging { ): UsersWithFilterResult! } +type Address { + id: String! + street: String! + city: String! +} + +type AddressNotFound implements Error { + id: String! + message: String! +} + +"Information about pagination in a connection." +type PageInfo { + "Indicates whether more edges exist following the set defined by the clients arguments." + hasNextPage: Boolean! + "Indicates whether more edges exist prior the set defined by the clients arguments." + hasPreviousPage: Boolean! + "When paginating backwards, the cursor to continue." + startCursor: String + "When paginating forwards, the cursor to continue." + endCursor: String +} + type User { id: String! name: String! @@ -104,6 +100,10 @@ type UsersWithFilterEdge { node: User! } +interface Error { + message: String! +} + union AddressResult = Address | AddressNotFound union UsersResult = UsersConnection | UserNotFound diff --git a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.FieldResult_With_Errors_Are_Valid.graphql b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.FieldResult_With_Errors_Are_Valid.graphql index 2c797e30094..81cda4f56c4 100644 --- a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.FieldResult_With_Errors_Are_Valid.graphql +++ b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.FieldResult_With_Errors_Are_Valid.graphql @@ -2,8 +2,8 @@ schema { query: ValidQueryValueTask } -interface Error { - message: String! +type ValidQueryValueTask { + foo: FooResult! } type ArgumentError implements Error { @@ -15,8 +15,8 @@ type Foo { bar: String! } -type ValidQueryValueTask { - foo: FooResult! +interface Error { + message: String! } union FooResult = Foo | ArgumentError diff --git a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_Exceptions.graphql b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_Exceptions.graphql index 57c1a3b3ddb..c963e09c81d 100644 --- a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_Exceptions.graphql +++ b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_Exceptions.graphql @@ -2,8 +2,8 @@ schema { query: QueryWithExceptionType } -interface Error { - message: String! +type QueryWithExceptionType { + userById(id: String!): UserByIdResult! } type Address { @@ -17,10 +17,6 @@ type AddressNotFound implements Error { message: String! } -type QueryWithExceptionType { - userById(id: String!): UserByIdResult! -} - type User { id: String! name: String! @@ -32,6 +28,10 @@ type UserNotFoundError implements Error { message: String! } +interface Error { + message: String! +} + union AddressResult = Address | AddressNotFound union UserByIdResult = User | UserNotFoundError diff --git a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_FieldResult.graphql b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_FieldResult.graphql index 3817678724a..3a27355345a 100644 --- a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_FieldResult.graphql +++ b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_FieldResult.graphql @@ -2,8 +2,8 @@ schema { query: QueryWithFieldResultType } -interface Error { - message: String! +type QueryWithFieldResultType { + userById(id: String!): UserByIdResult! } type Address { @@ -17,10 +17,6 @@ type AddressNotFound implements Error { message: String! } -type QueryWithFieldResultType { - userById(id: String!): UserByIdResult! -} - type User { id: String! name: String! @@ -33,6 +29,10 @@ type UserNotFound implements Error { message: String! } +interface Error { + message: String! +} + union AddressResult = Address | AddressNotFound union UserByIdResult = User | UserNotFound diff --git a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_FieldResult_And_Exceptions.graphql b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_FieldResult_And_Exceptions.graphql index a863c30a183..e69063b97d0 100644 --- a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_FieldResult_And_Exceptions.graphql +++ b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_FieldResult_And_Exceptions.graphql @@ -2,8 +2,8 @@ schema { query: QueryWithFieldResultAndExceptionType } -interface Error { - message: String! +type QueryWithFieldResultAndExceptionType { + userById(id: String!): UserByIdResult! } type Address { @@ -21,10 +21,6 @@ type InvalidUserIdError implements Error { message: String! } -type QueryWithFieldResultAndExceptionType { - userById(id: String!): UserByIdResult! -} - type User { id: String! name: String! @@ -37,6 +33,10 @@ type UserNotFound implements Error { message: String! } +interface Error { + message: String! +} + union AddressResult = Address | AddressNotFound union UserByIdResult = User | UserNotFound | InvalidUserIdError diff --git a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_FieldResult_And_Paging.graphql b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_FieldResult_And_Paging.graphql index 367ad5ed24d..a714d0862d5 100644 --- a/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_FieldResult_And_Paging.graphql +++ b/src/HotChocolate/Core/test/Types.Queries.Tests/__snapshots__/CodeFirstSchemaTests.Schema_Query_With_FieldResult_And_Paging.graphql @@ -2,33 +2,6 @@ schema { query: QueryWithFieldResultAndPagingType } -interface Error { - message: String! -} - -type Address { - id: String! - street: String! - city: String! -} - -type AddressNotFound implements Error { - id: String! - message: String! -} - -"Information about pagination in a connection." -type PageInfo { - "Indicates whether more edges exist following the set defined by the clients arguments." - hasNextPage: Boolean! - "Indicates whether more edges exist prior the set defined by the clients arguments." - hasPreviousPage: Boolean! - "When paginating backwards, the cursor to continue." - startCursor: String - "When paginating forwards, the cursor to continue." - endCursor: String -} - type QueryWithFieldResultAndPagingType { users( error: Boolean! = false @@ -56,6 +29,29 @@ type QueryWithFieldResultAndPagingType { ): UsersWithFilterResult! } +type Address { + id: String! + street: String! + city: String! +} + +type AddressNotFound implements Error { + id: String! + message: String! +} + +"Information about pagination in a connection." +type PageInfo { + "Indicates whether more edges exist following the set defined by the clients arguments." + hasNextPage: Boolean! + "Indicates whether more edges exist prior the set defined by the clients arguments." + hasPreviousPage: Boolean! + "When paginating backwards, the cursor to continue." + startCursor: String + "When paginating forwards, the cursor to continue." + endCursor: String +} + type User { id: String! name: String! @@ -104,6 +100,10 @@ type UsersWithFilterEdge { node: User } +interface Error { + message: String! +} + union AddressResult = Address | AddressNotFound union UsersResult = UsersConnection | UserNotFound diff --git a/src/HotChocolate/Core/test/Types.Records.Tests/__snapshots__/RecordsTests.Records_Clone_Member_Is_Removed.snap b/src/HotChocolate/Core/test/Types.Records.Tests/__snapshots__/RecordsTests.Records_Clone_Member_Is_Removed.snap index 9f7ecc30da5..5acf8db7a7c 100644 --- a/src/HotChocolate/Core/test/Types.Records.Tests/__snapshots__/RecordsTests.Records_Clone_Member_Is_Removed.snap +++ b/src/HotChocolate/Core/test/Types.Records.Tests/__snapshots__/RecordsTests.Records_Clone_Member_Is_Removed.snap @@ -1,12 +1,12 @@ -schema { +schema { query: Query } +type Query { + person: Person! +} + type Person { id: ID! name: String! } - -type Query { - person: Person! -} diff --git a/src/HotChocolate/Core/test/Types.Records.Tests/__snapshots__/RecordsTests.Records_Default_Value_Is_Taken_From_Ctor.snap b/src/HotChocolate/Core/test/Types.Records.Tests/__snapshots__/RecordsTests.Records_Default_Value_Is_Taken_From_Ctor.snap index b0c72534df9..9a680de8801 100644 --- a/src/HotChocolate/Core/test/Types.Records.Tests/__snapshots__/RecordsTests.Records_Default_Value_Is_Taken_From_Ctor.snap +++ b/src/HotChocolate/Core/test/Types.Records.Tests/__snapshots__/RecordsTests.Records_Default_Value_Is_Taken_From_Ctor.snap @@ -1,16 +1,16 @@ -schema { +schema { query: Query2 } +type Query2 { + person(defaultValueTest: DefaultValueTestInput): DefaultValueTest! +} + type DefaultValueTest { id: ID! name: String! } -type Query2 { - person(defaultValueTest: DefaultValueTestInput): DefaultValueTest! -} - input DefaultValueTestInput { id: ID! name: String! = "ShouldBeDefaultValue" diff --git a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTime.snap b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTime.snap index a87450e5fd3..3ca31ddc462 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTime.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTime.snap @@ -7,12 +7,6 @@ type QueryWithDateTime { dateTime(time: DateTime!): DateTime! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `DateTime` scalar type represents a date and time with time zone offset information." scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTimeFromModel.snap b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTimeFromModel.snap index f08eca88aa6..c801d019eaf 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTimeFromModel.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.InferDateTimeFromModel.snap @@ -2,6 +2,20 @@ schema { query: Query } +type Query { + items: [Model] + paging( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): PagingConnection +} + type Model { time: DateTime! date: Date! @@ -40,26 +54,6 @@ type PagingEdge { node: Model } -type Query { - items: [Model] - paging( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): PagingConnection -} - -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `Date` scalar type represents a date in UTC." scalar Date @specifiedBy(url: "https://scalars.graphql.org/chillicream/date.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.TypeDiscovery_Should_InferStructs.snap b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.TypeDiscovery_Should_InferStructs.snap index 0403a65dd02..74eeabe4415 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.TypeDiscovery_Should_InferStructs.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeDiscoveryTests.TypeDiscovery_Should_InferStructs.snap @@ -2,11 +2,6 @@ schema { query: QueryTypeWithStruct } -type InferStruct { - id: UUID! - number: Int! -} - type QueryTypeWithStruct { struct: InferStruct! nullableStruct: InferStruct @@ -18,11 +13,10 @@ type QueryTypeWithStruct { scalarDateTime: DateTime! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR +type InferStruct { + id: UUID! + number: Int! +} "The `DateTime` scalar type represents a date and time with time zone offset information." scalar DateTime diff --git a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeScopeInterceptorTests.BranchTypesWithScope.snap b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeScopeInterceptorTests.BranchTypesWithScope.snap index 67c7bebe702..403b2391273 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeScopeInterceptorTests.BranchTypesWithScope.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeScopeInterceptorTests.BranchTypesWithScope.snap @@ -2,6 +2,11 @@ schema { query: Foo } +type Foo { + bar1: A_Bar! + bar2: B_Bar! +} + type A_Bar { baz: C_Baz! someString: String! @@ -15,8 +20,3 @@ type B_Bar { type C_Baz { someString: String! } - -type Foo { - bar1: A_Bar! - bar2: B_Bar! -} diff --git a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Are_Never_Removed.snap b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Are_Never_Removed.snap index 96b46eebb24..ceb8b9fb03b 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Are_Never_Removed.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Are_Never_Removed.snap @@ -1,11 +1,7 @@ -schema { +schema { query: abc } -interface def { - field: String -} - type abc { field: def } @@ -14,4 +10,8 @@ type ghi implements def { field: String } +interface def { + field: String +} + directive @_abc on QUERY diff --git a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Are_Never_Removed_2.snap b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Are_Never_Removed_2.snap index 20777a7a0fb..dd4f4d7d597 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Are_Never_Removed_2.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Are_Never_Removed_2.snap @@ -1,11 +1,7 @@ -schema { +schema { query: abc } -interface def { - field: String -} - type abc { field: def } @@ -14,4 +10,8 @@ type ghi implements def { field: String } +interface def { + field: String +} + directive @_abc on QUERY | OBJECT diff --git a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Should_Be_Visited.snap b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Should_Be_Visited.snap index 699d26f5f2e..adc56f371cd 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Should_Be_Visited.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Executable_Directives_Should_Be_Visited.snap @@ -2,10 +2,6 @@ schema { query: abc } -interface def { - field: String -} - type abc { field: def } @@ -14,14 +10,12 @@ type ghi implements def { field: String } -directive @_abc(arg: UUID) on QUERY | OBJECT - -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR +interface def { + field: String +} "The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." scalar UUID @specifiedBy(url: "https://scalars.graphql.org/chillicream/uuid.html") + +directive @_abc(arg: UUID) on QUERY | OBJECT diff --git a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Interface_Implementors_Correctly_Detected.snap b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Interface_Implementors_Correctly_Detected.snap index 98df9201fbe..20f09c50c9e 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Interface_Implementors_Correctly_Detected.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Interface_Implementors_Correctly_Detected.snap @@ -1,11 +1,7 @@ -schema { +schema { query: abc } -interface def { - field: String -} - type abc { field: def } @@ -13,3 +9,7 @@ type abc { type ghi implements def { field: String } + +interface def { + field: String +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Interface_Implementors_Correctly_Detected_2.snap b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Interface_Implementors_Correctly_Detected_2.snap index 8700564ceb7..156bee24d27 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Interface_Implementors_Correctly_Detected_2.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Interface_Implementors_Correctly_Detected_2.snap @@ -1,11 +1,7 @@ -schema { +schema { query: abc } -interface def { - field: String -} - type abc { field: ghi } @@ -13,3 +9,7 @@ type abc { type ghi implements def { field: String } + +interface def { + field: String +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Unused_TypeSystem_Directives_Are_Removed.snap b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Unused_TypeSystem_Directives_Are_Removed.snap index 9bc0572db1c..8e1ca685849 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Unused_TypeSystem_Directives_Are_Removed.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Configuration/__snapshots__/TypeTrimmerTests.Unused_TypeSystem_Directives_Are_Removed.snap @@ -1,11 +1,7 @@ -schema { +schema { query: abc } -interface def { - field: String -} - type abc { field: def } @@ -14,4 +10,8 @@ type ghi implements def @_abc { field: String } +interface def { + field: String +} + directive @_abc on OBJECT diff --git a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeDescT_ConfigureQueryType_SchemaIsCreated.snap b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeDescT_ConfigureQueryType_SchemaIsCreated.snap index 66df5054aeb..1c7973adf51 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeDescT_ConfigureQueryType_SchemaIsCreated.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeDescT_ConfigureQueryType_SchemaIsCreated.snap @@ -1,12 +1,12 @@ -schema { +schema { query: Query mutation: Foo } -type Foo { - bar: String -} - type Query { foo: String } + +type Foo { + bar: String +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeDesc_ConfigureQueryType_SchemaIsCreated.snap b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeDesc_ConfigureQueryType_SchemaIsCreated.snap index 66df5054aeb..1c7973adf51 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeDesc_ConfigureQueryType_SchemaIsCreated.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeDesc_ConfigureQueryType_SchemaIsCreated.snap @@ -1,12 +1,12 @@ -schema { +schema { query: Query mutation: Foo } -type Foo { - bar: String -} - type Query { foo: String } + +type Foo { + bar: String +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeObjectType_TypeIsFooType_SchemaIsCreated.snap b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeObjectType_TypeIsFooType_SchemaIsCreated.snap index 80dc7c8fdb9..f68d37c94fd 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeObjectType_TypeIsFooType_SchemaIsCreated.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeObjectType_TypeIsFooType_SchemaIsCreated.snap @@ -3,14 +3,14 @@ schema { mutation: Foo } -type Bar { - baz: String! +type Query { + foo: String } type Foo { bar: Bar! } -type Query { - foo: String +type Bar { + baz: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeType_TypeIsFooType_SchemaIsCreated.snap b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeType_TypeIsFooType_SchemaIsCreated.snap index 80dc7c8fdb9..f68d37c94fd 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeType_TypeIsFooType_SchemaIsCreated.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddMutationTypeType_TypeIsFooType_SchemaIsCreated.snap @@ -3,14 +3,14 @@ schema { mutation: Foo } -type Bar { - baz: String! +type Query { + foo: String } type Foo { bar: Bar! } -type Query { - foo: String +type Bar { + baz: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddQueryTypeObjectType_TypeIsFooType_SchemaIsCreated.snap b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddQueryTypeObjectType_TypeIsFooType_SchemaIsCreated.snap index 0ad25fb4aa2..11420c063c2 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddQueryTypeObjectType_TypeIsFooType_SchemaIsCreated.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddQueryTypeObjectType_TypeIsFooType_SchemaIsCreated.snap @@ -2,10 +2,10 @@ schema { query: Foo } -type Bar { - baz: String! -} - type Foo { bar: Bar! } + +type Bar { + baz: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddQueryTypeType_TypeIsFooType_SchemaIsCreated.snap b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddQueryTypeType_TypeIsFooType_SchemaIsCreated.snap index 0ad25fb4aa2..11420c063c2 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddQueryTypeType_TypeIsFooType_SchemaIsCreated.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddQueryTypeType_TypeIsFooType_SchemaIsCreated.snap @@ -2,10 +2,10 @@ schema { query: Foo } -type Bar { - baz: String! -} - type Foo { bar: Bar! } + +type Bar { + baz: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeDescT_ConfQueryType_SchemaIsCreated.snap b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeDescT_ConfQueryType_SchemaIsCreated.snap index e007ad3f7b8..815d33d008e 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeDescT_ConfQueryType_SchemaIsCreated.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeDescT_ConfQueryType_SchemaIsCreated.snap @@ -1,12 +1,12 @@ -schema { +schema { query: Query subscription: Foo } -type Foo { - bar: String -} - type Query { foo: String } + +type Foo { + bar: String +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeDesc_ConfigureQueryType_SchemaIsCreated.snap b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeDesc_ConfigureQueryType_SchemaIsCreated.snap index e007ad3f7b8..815d33d008e 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeDesc_ConfigureQueryType_SchemaIsCreated.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeDesc_ConfigureQueryType_SchemaIsCreated.snap @@ -1,12 +1,12 @@ -schema { +schema { query: Query subscription: Foo } -type Foo { - bar: String -} - type Query { foo: String } + +type Foo { + bar: String +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeObjType_TypeIsFooType_SchemaIsCreated.snap b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeObjType_TypeIsFooType_SchemaIsCreated.snap index 3df62be4e3d..325c5cf59d8 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeObjType_TypeIsFooType_SchemaIsCreated.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeObjType_TypeIsFooType_SchemaIsCreated.snap @@ -3,14 +3,14 @@ schema { subscription: Foo } -type Bar { - baz: String! +type Query { + foo: String } type Foo { bar: Bar! } -type Query { - foo: String +type Bar { + baz: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeType_TypeIsFooType_SchemaIsCreated.snap b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeType_TypeIsFooType_SchemaIsCreated.snap index 3df62be4e3d..325c5cf59d8 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeType_TypeIsFooType_SchemaIsCreated.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Extensions/__snapshots__/SchemaBuilderExtensionsTypeTests.AddSubscriptionTypeType_TypeIsFooType_SchemaIsCreated.snap @@ -3,14 +3,14 @@ schema { subscription: Foo } -type Bar { - baz: String! +type Query { + foo: String } type Foo { bar: Bar! } -type Query { - foo: String +type Bar { + baz: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Regressions/Issue_4811.cs b/src/HotChocolate/Core/test/Types.Tests/Regressions/Issue_4811.cs index 07ffd4aef48..c8a2170417f 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Regressions/Issue_4811.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Regressions/Issue_4811.cs @@ -23,20 +23,20 @@ public async Task Compatible_Constructor_Can_Be_Found_For_Inputs() mutation: Mutation } - type ADDBookResponse { - title: String! - } - - type Book { - title: String! + type Query { + book: Book! } type Mutation { addBook(input: CreateCnaeInput!): ADDBookResponse! } - type Query { - book: Book! + type ADDBookResponse { + title: String! + } + + type Book { + title: String! } input CNAEMutationInput { diff --git a/src/HotChocolate/Core/test/Types.Tests/SchemaDocumentFormatterTests.cs b/src/HotChocolate/Core/test/Types.Tests/SchemaDocumentFormatterTests.cs deleted file mode 100644 index ef31ef643e7..00000000000 --- a/src/HotChocolate/Core/test/Types.Tests/SchemaDocumentFormatterTests.cs +++ /dev/null @@ -1,121 +0,0 @@ -using HotChocolate.Execution; -using HotChocolate.Language; -using Microsoft.Extensions.DependencyInjection; - -namespace HotChocolate; - -public static class SchemaDocumentFormatterTests -{ - [Fact] - public static async Task Add_No_Schema_Formatter() - { - var schema = - await new ServiceCollection() - .AddGraphQLServer() - .AddQueryType() - .BuildSchemaAsync(); - - schema.MatchInlineSnapshot( - """ - schema { - query: Query - } - - type Query { - hello: String! - } - """); - } - - [Fact] - public static async Task Add_Single_Schema_Formatter() - { - var schema = - await new ServiceCollection() - .AddGraphQLServer() - .AddQueryType() - .ConfigureSchemaServices(sp => sp.AddSingleton()) - .BuildSchemaAsync(); - - schema.MatchInlineSnapshot( - """ - schema { - query: Query - } - - type Query { - hello: String! - } - - scalar Scalar1 - """); - } - - [Fact] - public static async Task Add_Two_Schema_Formatters() - { - var schema = - await new ServiceCollection() - .AddGraphQLServer() - .AddQueryType() - .ConfigureSchemaServices( - sp => - sp.AddSingleton() - .AddSingleton()) - .BuildSchemaAsync(); - - schema.MatchInlineSnapshot( - """ - schema { - query: Query - } - - type Query { - hello: String! - } - - scalar Scalar1 - - scalar Scalar2 - """); - } - - public class Query - { - public string Hello() => "Hello"; - } - - public class Formatter1 : ISchemaDocumentFormatter - { - public DocumentNode Format(DocumentNode schemaDocument) - { - var definitions = schemaDocument.Definitions.ToList(); - - definitions.Add( - new ScalarTypeDefinitionNode( - null, - new NameNode("Scalar1"), - null, - Array.Empty())); - - return new DocumentNode(null, definitions); - } - } - - public class Formatter2 : ISchemaDocumentFormatter - { - public DocumentNode Format(DocumentNode schemaDocument) - { - var definitions = schemaDocument.Definitions.ToList(); - - definitions.Add( - new ScalarTypeDefinitionNode( - null, - new NameNode("Scalar2"), - null, - Array.Empty())); - - return new DocumentNode(null, definitions); - } - } -} diff --git a/src/HotChocolate/Core/test/Types.Tests/SchemaSerializerTests.cs b/src/HotChocolate/Core/test/Types.Tests/SchemaSerializerTests.cs deleted file mode 100644 index 3bd3d80fd5d..00000000000 --- a/src/HotChocolate/Core/test/Types.Tests/SchemaSerializerTests.cs +++ /dev/null @@ -1,201 +0,0 @@ -using System.Text; -using HotChocolate.Types; - -namespace HotChocolate; - -public class SchemaSerializerTests -{ - [Fact] - public void Serialize_SchemaIsNull_ArgumentNullException() - { - // arrange - // act - void Action() => SchemaPrinter.Print(null); - - // assert - Assert.Throws(Action); - } - - [Fact] - public void SerializeSchemaWriter_SchemaIsNull_ArgumentNullException() - { - // arrange - // act - void Action() => SchemaPrinter.Serialize(null, new StringWriter()); - - // assert - Assert.Throws(Action); - } - - [Fact] - public void SerializeSchemaWriter_WriterIsNull_ArgumentNullException() - { - // arrange - var schema = SchemaBuilder.New() - .AddDocumentFromString("type Query { foo: String }") - .AddResolver("Query", "foo", "bar") - .Create(); - - // act - void Action() => SchemaPrinter.Serialize(schema, null); - - // assert - Assert.Throws(Action); - } - - [Fact] - public async Task SerializeAsync_SchemaIsNull_ArgumentNullException() - { - // arrange - // act - async Task Action() => await SchemaPrinter.PrintAsync(default(Schema), new MemoryStream()); - - // assert - await Assert.ThrowsAsync(Action); - } - - [Fact] - public async Task SerializeAsync_WriterIsNull_ArgumentNullException() - { - // arrange - var schema = SchemaBuilder.New() - .AddDocumentFromString("type Query { foo: String }") - .AddResolver("Query", "foo", "bar") - .Create(); - - // act - async Task Action() => await SchemaPrinter.PrintAsync(schema, null); - - // assert - await Assert.ThrowsAsync(Action); - } - - [Fact] - public void SerializeSchemaWriter_Serialize() - { - // arrange - var schema = SchemaBuilder.New() - .AddDocumentFromString("type Query { foo: String }") - .AddResolver("Query", "foo", "bar") - .Create(); - var stringBuilder = new StringBuilder(); - - // act - SchemaPrinter.Serialize(schema, new StringWriter(stringBuilder)); - - // assert - stringBuilder.ToString().MatchSnapshot(); - } - - [Fact] - public async Task SerializeAsync_Serialize() - { - // arrange - var schema = SchemaBuilder.New() - .AddDocumentFromString("type Query { foo: String }") - .AddResolver("Query", "foo", "bar") - .Create(); - await using var stream = new MemoryStream(); - - // act - await SchemaPrinter.PrintAsync(schema, stream); - - // assert - Encoding.UTF8.GetString(stream.ToArray()).MatchSnapshot(); - } - - [Fact] - public void SerializeSchemaWithDirective() - { - // arrange - var schema = SchemaBuilder.New() - .AddDocumentFromString(FileResource.Open("serialize_schema.graphql")) - .AddDirectiveType(new DirectiveType(t => t - .Name("upper") - .Location(DirectiveLocation.FieldDefinition))) - .Use(next => next) - .ModifyOptions(o => o.StrictValidation = false) - .Create(); - - // act - var serializedSchema = schema.ToString(); - - // assert - serializedSchema.MatchSnapshot(); - } - - [Fact] - public void SerializeSchemaWithMutationWithoutSubscription() - { - // arrange - var schema = SchemaBuilder.New() - .AddDocumentFromString(FileResource.Open("serialize_schema_with_mutation.graphql")) - .Use(next => next) - .Create(); - - // act - var serializedSchema = schema.ToString(); - - // assert - serializedSchema.MatchSnapshot(); - } - - [Fact] - public async Task SerializeTypes() - { - // arrange - var schema = SchemaBuilder.New() - .AddDocumentFromString(FileResource.Open("serialize_schema_with_mutation.graphql")) - .Use(next => next) - .Create(); - - // act - await using var stream = new MemoryStream(); - await SchemaPrinter.PrintAsync( - new ITypeDefinition[] { schema.QueryType }, - stream, - true); - - // assert - Encoding.UTF8.GetString(stream.ToArray()).MatchSnapshot(); - } - - [Fact] - public async Task SerializeTypes_Types_Is_Null() - { - // arrange & act - await using var stream = new MemoryStream(); - async Task Fail() => await SchemaPrinter.PrintAsync( - default(IEnumerable), - stream, - true); - - // assert - await Assert.ThrowsAsync(Fail); - } - - [Fact] - public async Task SerializeTypes_Stream_Is_Null() - { - // arrange - var schema = SchemaBuilder.New() - .AddDocumentFromString(FileResource.Open("serialize_schema_with_mutation.graphql")) - .Use(next => next) - .Create(); - - // act - await using var stream = new MemoryStream(); - async Task Fail() => await SchemaPrinter.PrintAsync( - [schema.QueryType], - null, - true); - - // assert - await Assert.ThrowsAsync(Fail); - } - - public class Query - { - public required string Bar { get; set; } - } -} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/BindingBehaviorTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/BindingBehaviorTests.cs index e06df2c419b..1246d2e1b1f 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/BindingBehaviorTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/BindingBehaviorTests.cs @@ -22,15 +22,15 @@ public async Task BindingBehavior_Explicit_All_Attributes() query: Query } + type Query { + books: Book1! + } + type Book1 { title: String! category: BookCategory1! } - type Query { - books: Book1! - } - enum BookCategory1 { A B @@ -112,15 +112,15 @@ public async Task BindingBehavior_Explicit_Enum_Bound_With_Fluent() query: Query } + type Query { + books: Book3! + } + type Book3 { title: String! category: BookCategory3! } - type Query { - books: Book3! - } - enum BookCategory3 { A } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Composite/LookupTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/Composite/LookupTests.cs index 37f96f05fde..cba5295a869 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Composite/LookupTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Composite/LookupTests.cs @@ -20,15 +20,15 @@ public static async Task Lookup() query: Query1 } + type Query1 { + bookById(id: Int!): Book1! @lookup + } + type Book1 { id: Int! title: String! } - type Query1 { - bookById(id: Int!): Book1! @lookup - } - """ The @lookup directive is used within a source schema to specify output fields that can be used by the distributed GraphQL executor to resolve an entity by @@ -53,14 +53,16 @@ public static async Task Lookup_With_Is_Argument() query: Query2 } + type Query2 { + bookById(id: Int! @is(field: "id")): Book2! @lookup + } + type Book2 { id: Int! title: String! } - type Query2 { - bookById(id: Int! @is(field: "id")): Book2! @lookup - } + scalar FieldSelectionMap """ The @is directive is utilized on lookup fields to describe how the arguments @@ -74,8 +76,6 @@ that can be used by the distributed GraphQL executor to resolve an entity by a stable key. """ directive @lookup on FIELD_DEFINITION - - scalar FieldSelectionMap """"); } @@ -94,14 +94,18 @@ public static async Task Entity_With_Key() query: Query3 } + type Query3 { + bookById(id: Int! @is(field: "id")): Book3! @lookup + } + type Book3 @key(fields: "id") { id: Int! title: String! } - type Query3 { - bookById(id: Int! @is(field: "id")): Book3! @lookup - } + scalar FieldSelectionMap + + scalar FieldSelectionSet """ The @is directive is utilized on lookup fields to describe how the arguments @@ -122,10 +126,6 @@ that can be used by the distributed GraphQL executor to resolve an entity by a stable key. """ directive @lookup on FIELD_DEFINITION - - scalar FieldSelectionMap - - scalar FieldSelectionSet """"); } @@ -144,21 +144,25 @@ public static async Task Lookup_With_OneOf() query: Query4 } - type Book4 @key(fields: "id") { - id: Int! - title: String! - } - type Query4 { book(by: Book4ByInput! @is(field: "{\n id\n} | {\n title\n}")): Book4! @lookup } + type Book4 @key(fields: "id") { + id: Int! + title: String! + } + input Book4ByInput @oneOf { id: Int title: String } + scalar FieldSelectionMap + + scalar FieldSelectionSet + """ The @is directive is utilized on lookup fields to describe how the arguments can be mapped from the entity type that the lookup field resolves. @@ -178,13 +182,6 @@ that can be used by the distributed GraphQL executor to resolve an entity by a stable key. """ directive @lookup on FIELD_DEFINITION - - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT - - scalar FieldSelectionMap - - scalar FieldSelectionSet """"); } @@ -203,15 +200,17 @@ public static async Task Require_With_Explicit_Field() query: Query5 } + type Query5 { + book: Book5! + } + type Book5 { someField(author: String! @require(field: "author")): String! id: Int! title: String! } - type Query5 { - book: Book5! - } + scalar FieldSelectionMap """ The @require directive is used to express data requirements with other source schemas. @@ -222,8 +221,6 @@ Arguments annotated with the @require directive are removed from the composite s directive @require(field: FieldSelectionMap!) on ARGUMENT_DEFINITION """ directive @require("The field selection map syntax." field: FieldSelectionMap!) on ARGUMENT_DEFINITION - - scalar FieldSelectionMap """"); } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/SerializeAsTests.SerializeAs_Is_Added.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/SerializeAsTests.SerializeAs_Is_Added.graphql index 98f51d9d58e..2952ff663f4 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/SerializeAsTests.SerializeAs_Is_Added.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/SerializeAsTests.SerializeAs_Is_Added.graphql @@ -24,15 +24,15 @@ enum ScalarSerializationType { LIST } +scalar Custom1 @serializeAs(type: STRING) + +scalar Custom2 @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) + +scalar Custom3 @serializeAs(type: STRING, pattern: "\\b\\d{3}\\b") + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - -scalar Custom1 @serializeAs(type: STRING) - -scalar Custom2 @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) - -scalar Custom3 @serializeAs(type: STRING, pattern: "\\b\\d{3}\\b") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.New_On_PageInfo_Is_Shareable.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.New_On_PageInfo_Is_Shareable.graphql index e085ee03c2c..c5a1745d027 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.New_On_PageInfo_Is_Shareable.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.New_On_PageInfo_Is_Shareable.graphql @@ -2,6 +2,19 @@ schema { query: Query1 } +type Query1 { + names( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): NamesConnection +} + "A connection to a list of items." type NamesConnection { "Information to aid in pagination." @@ -33,19 +46,6 @@ type PageInfo { new: Int! @shareable } -type Query1 { - names( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): NamesConnection -} - """ By default, only a single source schema is allowed to contribute a particular field to an object type. diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.New_On_PageInfo_Is_Shareable_Fluent.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.New_On_PageInfo_Is_Shareable_Fluent.graphql index 99248067907..7565e819bee 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.New_On_PageInfo_Is_Shareable_Fluent.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.New_On_PageInfo_Is_Shareable_Fluent.graphql @@ -2,6 +2,19 @@ schema { query: Query1 } +type Query1 { + names( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): NamesConnection +} + "A connection to a list of items." type NamesConnection { "Information to aid in pagination." @@ -33,19 +46,6 @@ type PageInfo { new: String @shareable } -type Query1 { - names( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): NamesConnection -} - """ By default, only a single source schema is allowed to contribute a particular field to an object type. diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.PageInfo_Is_Shareable.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.PageInfo_Is_Shareable.graphql index 27efffe9b5d..1b9a3504713 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.PageInfo_Is_Shareable.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.PageInfo_Is_Shareable.graphql @@ -2,6 +2,19 @@ schema { query: Query1 } +type Query1 { + names( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): NamesConnection +} + "A connection to a list of items." type NamesConnection { "Information to aid in pagination." @@ -32,19 +45,6 @@ type PageInfo @shareable { endCursor: String } -type Query1 { - names( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): NamesConnection -} - """ By default, only a single source schema is allowed to contribute a particular field to an object type. diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.PageInfo_Is_Shareable_Fluent.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.PageInfo_Is_Shareable_Fluent.graphql index 27efffe9b5d..1b9a3504713 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.PageInfo_Is_Shareable_Fluent.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.PageInfo_Is_Shareable_Fluent.graphql @@ -2,6 +2,19 @@ schema { query: Query1 } +type Query1 { + names( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): NamesConnection +} + "A connection to a list of items." type NamesConnection { "Information to aid in pagination." @@ -32,19 +45,6 @@ type PageInfo @shareable { endCursor: String } -type Query1 { - names( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): NamesConnection -} - """ By default, only a single source schema is allowed to contribute a particular field to an object type. diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.Shareable_On_Type_That_Is_Both_Input_And_Output_Type.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.Shareable_On_Type_That_Is_Both_Input_And_Output_Type.graphql index 7f782a6ec8b..b99c0bf6437 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.Shareable_On_Type_That_Is_Both_Input_And_Output_Type.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/ShareableTests.Shareable_On_Type_That_Is_Both_Input_And_Output_Type.graphql @@ -2,14 +2,14 @@ schema { query: Query2 } -type BothInputAndOutput @shareable { - field: String -} - type Query2 { output(input: BothInputAndOutputInput!): BothInputAndOutput! } +type BothInputAndOutput @shareable { + field: String +} + input BothInputAndOutputInput { field: String } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/DescriptionTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/DescriptionTests.cs index 5ab08b8c1be..7c5ee4121ae 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/DescriptionTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/DescriptionTests.cs @@ -14,8 +14,7 @@ public async Task Schema_With_All_Possible_Descriptions() // act // assert - SchemaPrinter - .PrintSchema(schema) + schema.ToSyntaxNode() .Print(indented: true) .MatchSnapshot(extension: ".graphql"); } @@ -28,8 +27,7 @@ public async Task Schema_With_All_Possible_Descriptions_No_Indent() // act // assert - SchemaPrinter - .PrintSchema(schema) + schema.ToSyntaxNode() .Print(indented: false) .MatchSnapshot(extension: ".graphql"); } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Directives/__snapshots__/SpecifiedByDirectiveTypeTests.EnsureSpecifiedByDirectiveExistsInSdl.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/Directives/__snapshots__/SpecifiedByDirectiveTypeTests.EnsureSpecifiedByDirectiveExistsInSdl.graphql index ba003f2aaf3..acca9f46534 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Directives/__snapshots__/SpecifiedByDirectiveTypeTests.EnsureSpecifiedByDirectiveExistsInSdl.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Directives/__snapshots__/SpecifiedByDirectiveTypeTests.EnsureSpecifiedByDirectiveExistsInSdl.graphql @@ -6,12 +6,6 @@ type Query1 { date: DateTime! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `DateTime` scalar type represents a date and time with time zone offset information." scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Directives/__snapshots__/TagDirectiveTests.EnsureAllLocationsAreApplied.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/Directives/__snapshots__/TagDirectiveTests.EnsureAllLocationsAreApplied.graphql index c4de2e34a40..a8e48946ed4 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Directives/__snapshots__/TagDirectiveTests.EnsureAllLocationsAreApplied.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Directives/__snapshots__/TagDirectiveTests.EnsureAllLocationsAreApplied.graphql @@ -2,19 +2,19 @@ schema @tag(name: "OnSchema") { query: Query } -interface IFoo @tag(name: "OnInterface") { - bar(baz: String! @tag(name: "OnInterfaceFieldArg")): String! - @tag(name: "OnInterfaceField") +type Query @tag(name: "OnObjectType") { + foo(a: String! @tag(name: "OnObjectFieldArg")): IFoo! + @tag(name: "OnObjectField") + fooEnum(input: FooInput!): FooEnum! } type Foo implements IFoo { bar(baz: String!): String! } -type Query @tag(name: "OnObjectType") { - foo(a: String! @tag(name: "OnObjectFieldArg")): IFoo! - @tag(name: "OnObjectField") - fooEnum(input: FooInput!): FooEnum! +interface IFoo @tag(name: "OnInterface") { + bar(baz: String! @tag(name: "OnInterfaceFieldArg")): String! + @tag(name: "OnInterfaceField") } input FooInput @tag(name: "OnInputObjectType") { diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/EnumFlagsTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/EnumFlagsTests.cs index 591c99e4b0f..2a187388859 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/EnumFlagsTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/EnumFlagsTests.cs @@ -59,16 +59,16 @@ public async Task Schema_With_Flags() query: Query } + type Query { + foo(input: FooBarBazFlagsInput!): FooBarBazFlags! + } + type FooBarBazFlags { isFoo: Boolean! isBar: Boolean! isBaz: Boolean! } - type Query { - foo(input: FooBarBazFlagsInput!): FooBarBazFlags! - } - input FooBarBazFlagsInput { isFoo: Boolean isBar: Boolean diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Description.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Description.snap index 36061b0eaaa..f798facdfde 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Description.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Description.snap @@ -1,7 +1,11 @@ -schema { +schema { query: Query } +type Query { + asd(input: FlagsWithDescriptionFlagsInput!): FlagsWithDescriptionFlags! +} + "This is the type desc" type FlagsWithDescriptionFlags { "Foo has a desc" @@ -12,10 +16,6 @@ type FlagsWithDescriptionFlags { isBaz: Boolean! } -type Query { - asd(input: FlagsWithDescriptionFlagsInput!): FlagsWithDescriptionFlags! -} - "This is the type desc" input FlagsWithDescriptionFlagsInput { "Foo has a desc" diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Inputs.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Inputs.snap index f4b22d3f39e..7870849b4c0 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Inputs.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Inputs.snap @@ -1,18 +1,18 @@ -schema { +schema { query: InputQuery } +type InputQuery { + loopback(args: FlagsEnumFlagsInput!): FlagsEnumFlags! + input(input: EnumInput!): FlagsEnumFlags! +} + type FlagsEnumFlags { isFoo: Boolean! isBar: Boolean! isBaz: Boolean! } -type InputQuery { - loopback(args: FlagsEnumFlagsInput!): FlagsEnumFlags! - input(input: EnumInput!): FlagsEnumFlags! -} - input EnumInput { single: FlagsEnumFlagsInput! list: [FlagsEnumFlagsInput!]! diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Interface.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Interface.snap index 49889bfc463..6ad40bac177 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Interface.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Interface.snap @@ -1,9 +1,9 @@ -schema { +schema { query: Query } -interface Interface { - single: FlagsEnumFlags! +type Query { + asd: Interface } type FlagsEnumFlags { @@ -16,6 +16,6 @@ type Impl implements Interface { single: FlagsEnumFlags! } -type Query { - asd: Interface +interface Interface { + single: FlagsEnumFlags! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Outputs.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Outputs.snap index 10be7a07c13..7479399022c 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Outputs.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Interceptors/__snapshots__/FlagEnumInterceptorTests.Schema_Should_Generate_Outputs.snap @@ -1,13 +1,7 @@ -schema { +schema { query: OutputQuery } -type FlagsEnumFlags { - isFoo: Boolean! - isBar: Boolean! - isBaz: Boolean! -} - type OutputQuery { single: FlagsEnumFlags! list: [FlagsEnumFlags!]! @@ -16,3 +10,9 @@ type OutputQuery { nullableList: [FlagsEnumFlags] nullableNestedList: [[FlagsEnumFlags]] } + +type FlagsEnumFlags { + isFoo: Boolean! + isBar: Boolean! + isBaz: Boolean! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/IdAttributeTests.Id_Type_Is_Correctly_Inferred.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/IdAttributeTests.Id_Type_Is_Correctly_Inferred.snap index 015d867d6b9..dcfe9ea7f90 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/IdAttributeTests.Id_Type_Is_Correctly_Inferred.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/IdAttributeTests.Id_Type_Is_Correctly_Inferred.snap @@ -2,26 +2,6 @@ schema { query: Query } -interface IFooPayload { - someId: ID! - someNullableId: ID - someIds: [ID!]! - someNullableIds: [ID] - interceptedId: Int - interceptedIds: [Int!] - raw: String! -} - -type FooPayload implements IFooPayload { - someId: ID! - someIds: [ID!]! - someNullableId: ID - someNullableIds: [ID] - interceptedId: Int - interceptedIds: [Int!] - raw: String! -} - type Query { intId(id: ID!): Int! intIdList(ids: [ID!]!): [Int!]! @@ -50,6 +30,26 @@ type Query { foo(input: FooInput!): IFooPayload! } +type FooPayload implements IFooPayload { + someId: ID! + someIds: [ID!]! + someNullableId: ID + someNullableIds: [ID] + interceptedId: Int + interceptedIds: [Int!] + raw: String! +} + +interface IFooPayload { + someId: ID! + someNullableId: ID + someIds: [ID!]! + someNullableIds: [ID] + interceptedId: Int + interceptedIds: [Int!] + raw: String! +} + input FooInput { someId: ID! someNullableId: ID @@ -61,12 +61,6 @@ input FooInput { interceptedIds: [ID!] } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562." scalar UUID @specifiedBy(url: "https://scalars.graphql.org/chillicream/uuid.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/IdDescriptorTests.Id_Type_Is_Correctly_Inferred.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/IdDescriptorTests.Id_Type_Is_Correctly_Inferred.snap index 41bcfe82f0f..9388b947796 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/IdDescriptorTests.Id_Type_Is_Correctly_Inferred.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/IdDescriptorTests.Id_Type_Is_Correctly_Inferred.snap @@ -2,9 +2,11 @@ schema { query: Query } -interface IFooPayload { - someId: ID! - anotherId: ID! +type Query { + intId(id: ID!): String! + stringId(id: ID!): String! + guidId(id: ID!): String! + foo(input: FooInput): IFooPayload } type FooPayload implements IFooPayload { @@ -12,11 +14,9 @@ type FooPayload implements IFooPayload { anotherId: ID! } -type Query { - intId(id: ID!): String! - stringId(id: ID!): String! - guidId(id: ID!): String! - foo(input: FooInput): IFooPayload +interface IFooPayload { + someId: ID! + anotherId: ID! } input FooInput { diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension.snap index 145bd12a14f..c32c03a56a6 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension.snap @@ -2,9 +2,9 @@ schema { query: Query } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! +type Query { + entity(name: String!): Entity! + entity2(name: String!): Entity2! } type Entity implements Node { @@ -17,7 +17,7 @@ type Entity2 { name: String! } -type Query { - entity(name: String!): Entity! - entity2(name: String!): Entity2! +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension2.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension2.snap index 145bd12a14f..c32c03a56a6 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension2.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension2.snap @@ -2,9 +2,9 @@ schema { query: Query } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! +type Query { + entity(name: String!): Entity! + entity2(name: String!): Entity2! } type Entity implements Node { @@ -17,7 +17,7 @@ type Entity2 { name: String! } -type Query { - entity(name: String!): Entity! - entity2(name: String!): Entity2! +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension3.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension3.snap index 145bd12a14f..c32c03a56a6 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension3.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension3.snap @@ -2,9 +2,9 @@ schema { query: Query } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! +type Query { + entity(name: String!): Entity! + entity2(name: String!): Entity2! } type Entity implements Node { @@ -17,7 +17,7 @@ type Entity2 { name: String! } -type Query { - entity(name: String!): Entity! - entity2(name: String!): Entity2! +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension4.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension4.snap index 145bd12a14f..c32c03a56a6 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension4.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeResolverTests.NodeAttribute_On_Extension4.snap @@ -2,9 +2,9 @@ schema { query: Query } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! +type Query { + entity(name: String!): Entity! + entity2(name: String!): Entity2! } type Entity implements Node { @@ -17,7 +17,7 @@ type Entity2 { name: String! } -type Query { - entity(name: String!): Entity! - entity2(name: String!): Entity2! +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeTypeTests.Infer_Node_From_Query_Field_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeTypeTests.Infer_Node_From_Query_Field_Schema.snap index 87e5eb5db0f..78bdf5aae3c 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeTypeTests.Infer_Node_From_Query_Field_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeTypeTests.Infer_Node_From_Query_Field_Schema.snap @@ -2,9 +2,12 @@ schema { query: Query } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! +type Query { + "Fetches an object given its ID." + node("ID of the object." id: ID!): Node + "Lookup nodes by a list of IDs." + nodes("The list of node IDs." ids: [ID!]!): [Node]! + fooById(id: ID!): Foo! } type Foo implements Node { @@ -12,10 +15,7 @@ type Foo implements Node { clearTextId: String! } -type Query { - "Fetches an object given its ID." - node("ID of the object." id: ID!): Node - "Lookup nodes by a list of IDs." - nodes("The list of node IDs." ids: [ID!]!): [Node]! - fooById(id: ID!): Foo! +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeTypeTests.Node_Attribute_Does_Not_Throw_With_NodeResolver_On_Query.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeTypeTests.Node_Attribute_Does_Not_Throw_With_NodeResolver_On_Query.snap index 4abc558da6b..09980d53318 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeTypeTests.Node_Attribute_Does_Not_Throw_With_NodeResolver_On_Query.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeTypeTests.Node_Attribute_Does_Not_Throw_With_NodeResolver_On_Query.snap @@ -2,11 +2,6 @@ schema { query: Query7 } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! -} - type Query7 { "Fetches an object given its ID." node("ID of the object." id: ID!): Node @@ -19,3 +14,8 @@ type Qux implements Node { id: ID! clearTextId: String! } + +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeTypeTests.Node_Attribute_Does_Not_Throw_With_NodeResolver_On_Query_2.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeTypeTests.Node_Attribute_Does_Not_Throw_With_NodeResolver_On_Query_2.snap index f598e0bc778..8fd6f9ea74a 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeTypeTests.Node_Attribute_Does_Not_Throw_With_NodeResolver_On_Query_2.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/NodeTypeTests.Node_Attribute_Does_Not_Throw_With_NodeResolver_On_Query_2.snap @@ -2,9 +2,12 @@ schema { query: Query8 } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! +type Query8 { + "Fetches an object given its ID." + node("ID of the object." id: ID!): Node + "Lookup nodes by a list of IDs." + nodes("The list of node IDs." ids: [ID!]!): [Node]! + barById(id: ID!): Foo1! } type Foo1 implements Node { @@ -12,10 +15,7 @@ type Foo1 implements Node { clearTextId: String! } -type Query8 { - "Fetches an object given its ID." - node("ID of the object." id: ID!): Node - "Lookup nodes by a list of IDs." - nodes("The list of node IDs." ids: [ID!]!): [Node]! - barById(id: ID!): Foo1! +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Do_Not_Mark_Node_Field_As_Lookup.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Do_Not_Mark_Node_Field_As_Lookup.snap index 1f217808d2a..e22dfe4bb51 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Do_Not_Mark_Node_Field_As_Lookup.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Do_Not_Mark_Node_Field_As_Lookup.snap @@ -2,11 +2,6 @@ schema { query: QueryType } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! -} - type QueryType { "Fetches an object given its ID." node("ID of the object." id: ID!): Node @@ -18,3 +13,8 @@ type QueryType { type Some implements Node { id: ID! } + +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Mark_Node_Field_As_Lookup.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Mark_Node_Field_As_Lookup.snap index 74bdd706046..47af7cf1d17 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Mark_Node_Field_As_Lookup.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Mark_Node_Field_As_Lookup.snap @@ -2,11 +2,6 @@ schema { query: QueryType } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! -} - type QueryType { "Fetches an object given its ID." node("ID of the object." id: ID!): Node @lookup @shareable @@ -19,6 +14,11 @@ type Some implements Node { id: ID! } +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! +} + """ The @lookup directive is used within a source schema to specify output fields that can be used by the distributed GraphQL executor to resolve an entity by diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Node_Field_On_Query_Exists.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Node_Field_On_Query_Exists.snap index 1f217808d2a..e22dfe4bb51 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Node_Field_On_Query_Exists.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Node_Field_On_Query_Exists.snap @@ -2,11 +2,6 @@ schema { query: QueryType } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! -} - type QueryType { "Fetches an object given its ID." node("ID of the object." id: ID!): Node @@ -18,3 +13,8 @@ type QueryType { type Some implements Node { id: ID! } + +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Without_Nodes_Field.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Without_Nodes_Field.snap index d80c97310e6..75f973c927c 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Without_Nodes_Field.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddGlobalObjectIdentification_Without_Nodes_Field.snap @@ -2,11 +2,6 @@ schema { query: QueryType } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! -} - type QueryType { "Fetches an object given its ID." node("ID of the object." id: ID!): Node @@ -16,3 +11,8 @@ type QueryType { type Some implements Node { id: ID! } + +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_QueryField_On_MutationPayload_Exists.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_QueryField_On_MutationPayload_Exists.snap index 660e6be0a88..60162501ec6 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_QueryField_On_MutationPayload_Exists.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_QueryField_On_MutationPayload_Exists.snap @@ -3,23 +3,23 @@ schema { mutation: Mutation } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! -} - -type FooPayload { - query: QueryType! +type QueryType { + some: Some } type Mutation { foo: FooPayload! } -type QueryType { - some: Some +type FooPayload { + query: QueryType! } type Some implements Node { id: ID! } + +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_With_Different_FieldName.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_With_Different_FieldName.snap index 52ba9f1cb40..3ee6d0210e8 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_With_Different_FieldName.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_With_Different_FieldName.snap @@ -3,23 +3,23 @@ schema { mutation: Mutation } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! -} - -type FooPayload { - rootQuery: QueryType! +type QueryType { + some: Some } type Mutation { foo: FooPayload! } -type QueryType { - some: Some +type FooPayload { + rootQuery: QueryType! } type Some implements Node { id: ID! } + +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_With_Different_PayloadPredicate.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_With_Different_PayloadPredicate.snap index e99c4d7b507..e5343584668 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_With_Different_PayloadPredicate.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_With_Different_PayloadPredicate.snap @@ -3,9 +3,13 @@ schema { mutation: Mutation2 } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! +type QueryType { + some: Some +} + +type Mutation2 { + baz: BazPayload! + bar: BarResult! } type BarResult { @@ -16,15 +20,11 @@ type BazPayload { some: String } -type Mutation2 { - baz: BazPayload! - bar: BarResult! -} - -type QueryType { - some: Some +type Some implements Node { + id: ID! } -type Some implements Node { +"The node interface is implemented by entities that have a global unique identifier." +interface Node { id: ID! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_With_Extensions.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_With_Extensions.snap index 660e6be0a88..60162501ec6 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_With_Extensions.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Relay/__snapshots__/RelaySchemaTests.AddQueryFieldToMutationPayloads_With_Extensions.snap @@ -3,23 +3,23 @@ schema { mutation: Mutation } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! -} - -type FooPayload { - query: QueryType! +type QueryType { + some: Some } type Mutation { foo: FooPayload! } -type QueryType { - some: Some +type FooPayload { + query: QueryType! } type Some implements Node { id: ID! } + +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/AnyTypeTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/AnyTypeTests.cs index c404064dea5..a527271f011 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/AnyTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/AnyTypeTests.cs @@ -1452,12 +1452,6 @@ type QueryJsonElement { jsonFromString: Any! } - "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." - directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! - ) on SCALAR - "The `Any` scalar type represents any valid GraphQL value." scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") """); diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/CustomScalarTests.CustomDirective_With_Directives_Annotation.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/CustomScalarTests.CustomDirective_With_Directives_Annotation.graphql index 9470fc51656..1c5f8333c73 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/CustomScalarTests.CustomDirective_With_Directives_Annotation.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/CustomScalarTests.CustomDirective_With_Directives_Annotation.graphql @@ -6,6 +6,6 @@ type Query { sayHello: Custom! } -directive @custom on SCALAR - scalar Custom @custom + +directive @custom on SCALAR diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/CustomScalarTests.CustomDirective_With_Directives_Fluent.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/CustomScalarTests.CustomDirective_With_Directives_Fluent.graphql index 9470fc51656..1c5f8333c73 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/CustomScalarTests.CustomDirective_With_Directives_Fluent.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/CustomScalarTests.CustomDirective_With_Directives_Fluent.graphql @@ -6,6 +6,6 @@ type Query { sayHello: Custom! } -directive @custom on SCALAR - scalar Custom @custom + +directive @custom on SCALAR diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/CustomScalarTests.CustomDirective_With_Directives_SDL.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/CustomScalarTests.CustomDirective_With_Directives_SDL.graphql index 9470fc51656..1c5f8333c73 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/CustomScalarTests.CustomDirective_With_Directives_SDL.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/CustomScalarTests.CustomDirective_With_Directives_SDL.graphql @@ -6,6 +6,6 @@ type Query { sayHello: Custom! } -directive @custom on SCALAR - scalar Custom @custom + +directive @custom on SCALAR diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_Argument_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_Argument_Schema.snap index 1dd4a5ce11b..0aac82e4764 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_Argument_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_Argument_Schema.snap @@ -2,19 +2,13 @@ schema { query: QueryDate1 } -type Foo { - date(date: Date): Date -} - type QueryDate1 { foo: Foo! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR +type Foo { + date(date: Date): Date +} "The `Date` scalar type represents a date in UTC." scalar Date diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_ReturnValue_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_ReturnValue_Schema.snap index 575e3a35c5c..28b4d513ecd 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_ReturnValue_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DateTypeTests.DateOnly_As_ReturnValue_Schema.snap @@ -2,19 +2,13 @@ schema { query: QueryDate2 } -type Bar { - date: Date -} - type QueryDate2 { bar: Bar! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR +type Bar { + date: Date +} "The `Date` scalar type represents a date in UTC." scalar Date diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DurationTypeTests.ImplementationFirst_AutomaticallyBinds_TimeSpan.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DurationTypeTests.ImplementationFirst_AutomaticallyBinds_TimeSpan.snap index 5dec00d9f90..7d6b147f220 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DurationTypeTests.ImplementationFirst_AutomaticallyBinds_TimeSpan.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/DurationTypeTests.ImplementationFirst_AutomaticallyBinds_TimeSpan.snap @@ -6,12 +6,6 @@ type Query { duration: Duration! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `Duration` scalar type represents a duration of time." scalar Duration @specifiedBy(url: "https://scalars.graphql.org/chillicream/duration.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/Issue6970ReproTests.Schema_With_IDictionary_String_Object_Output_Field_Builds.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/Issue6970ReproTests.Schema_With_IDictionary_String_Object_Output_Field_Builds.snap index 6a3aeea4f77..46ea6fa6d25 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/Issue6970ReproTests.Schema_With_IDictionary_String_Object_Output_Field_Builds.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/Issue6970ReproTests.Schema_With_IDictionary_String_Object_Output_Field_Builds.snap @@ -2,19 +2,13 @@ schema { query: Query } -type PageVOAllergyIntolerance { - extension: Any! -} - type Query { item: PageVOAllergyIntolerance! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR +type PageVOAllergyIntolerance { + extension: Any! +} "The `Any` scalar type represents any valid GraphQL value." scalar Any @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_Argument_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_Argument_Schema.snap index 1272cc17bf5..c85cc9da5b9 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_Argument_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_Argument_Schema.snap @@ -2,19 +2,13 @@ schema { query: QueryDateTime1 } -type Foo { - localDateTime(localDateTime: LocalDateTime): LocalDateTime -} - type QueryDateTime1 { foo: Foo! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR +type Foo { + localDateTime(localDateTime: LocalDateTime): LocalDateTime +} "The `LocalDateTime` scalar type represents a date and time without time zone information." scalar LocalDateTime diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_ReturnValue_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_ReturnValue_Schema.snap index a1d2e934192..46ce84aaa7a 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_ReturnValue_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTimeTypeTests.LocalDateTime_As_ReturnValue_Schema.snap @@ -2,19 +2,13 @@ schema { query: QueryDateTime2 } -type Bar { - localDateTime: LocalDateTime -} - type QueryDateTime2 { bar: Bar! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR +type Bar { + localDateTime: LocalDateTime +} "The `LocalDateTime` scalar type represents a date and time without time zone information." scalar LocalDateTime diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_Argument_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_Argument_Schema.snap index 3eadee36d8d..58f649bf400 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_Argument_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_Argument_Schema.snap @@ -2,19 +2,13 @@ schema { query: QueryDateTime1 } -type Foo { - date(date: LocalDate!): LocalDate! -} - type QueryDateTime1 { foo: Foo! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR +type Foo { + date(date: LocalDate!): LocalDate! +} "The `LocalDate` scalar type represents a date without time or time zone information." scalar LocalDate diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_ReturnValue_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_ReturnValue_Schema.snap index 1a88752726e..a8fec2d1ebc 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_ReturnValue_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalDateTypeTests.DateOnly_As_ReturnValue_Schema.snap @@ -2,19 +2,13 @@ schema { query: QueryDateTime2 } -type Bar { - date: LocalDate! -} - type QueryDateTime2 { bar: Bar! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR +type Bar { + date: LocalDate! +} "The `LocalDate` scalar type represents a date without time or time zone information." scalar LocalDate diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_Argument_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_Argument_Schema.snap index dd8e8316692..3b4e819f2b7 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_Argument_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_Argument_Schema.snap @@ -2,19 +2,13 @@ schema { query: QueryDateTime1 } -type Foo { - time(time: LocalTime!): LocalTime! -} - type QueryDateTime1 { foo: Foo! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR +type Foo { + time(time: LocalTime!): LocalTime! +} "The `LocalTime` scalar type represents a time of day without date or time zone information." scalar LocalTime diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_ReturnValue_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_ReturnValue_Schema.snap index f48a6ab22c6..fe64e634385 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_ReturnValue_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/LocalTimeTypeTests.TimeOnly_As_ReturnValue_Schema.snap @@ -2,19 +2,13 @@ schema { query: QueryDateTime2 } -type Bar { - time: LocalTime! -} - type QueryDateTime2 { bar: Bar! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR +type Bar { + time: LocalTime! +} "The `LocalTime` scalar type represents a time of day without date or time zone information." scalar LocalTime diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/ScalarBindingTests.Ensure_That_Explicit_Binding_Behavior_Is_Respected_On_Scalars.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/ScalarBindingTests.Ensure_That_Explicit_Binding_Behavior_Is_Respected_On_Scalars.snap index 03208199dcb..572de2c533d 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/ScalarBindingTests.Ensure_That_Explicit_Binding_Behavior_Is_Respected_On_Scalars.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/ScalarBindingTests.Ensure_That_Explicit_Binding_Behavior_Is_Respected_On_Scalars.snap @@ -2,6 +2,10 @@ schema { query: QueryA } +type QueryA { + bar(id: FOO): Bar +} + type Bar { baz: Baz } @@ -10,16 +14,6 @@ type Baz { text: Decimal! } -type QueryA { - bar(id: FOO): Bar -} - -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `Decimal` scalar type represents a decimal floating-point number with high precision." scalar Decimal @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/ScalarBindingTests.Ensure_That_Implicit_Binding_Behavior_Is_Respected_On_Scalars.snap b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/ScalarBindingTests.Ensure_That_Implicit_Binding_Behavior_Is_Respected_On_Scalars.snap index df85212c024..3a52242d153 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/ScalarBindingTests.Ensure_That_Implicit_Binding_Behavior_Is_Respected_On_Scalars.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/__snapshots__/ScalarBindingTests.Ensure_That_Implicit_Binding_Behavior_Is_Respected_On_Scalars.snap @@ -2,6 +2,10 @@ schema { query: QueryB } +type QueryB { + bar(id: FOO): Bar +} + type Bar { baz: Baz } @@ -10,8 +14,4 @@ type Baz { text: FOO! } -type QueryB { - bar(id: FOO): Bar -} - scalar FOO diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/DescriptionTests.Schema_With_All_Possible_Descriptions.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/DescriptionTests.Schema_With_All_Possible_Descriptions.graphql index 23071624275..3ce14502f4d 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/DescriptionTests.Schema_With_All_Possible_Descriptions.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/DescriptionTests.Schema_With_All_Possible_Descriptions.graphql @@ -3,27 +3,22 @@ schema { query: Query } -"Single line comment" -interface OtherInterface { - field: String -} - """ Multi line comment """ -interface SomeInterface { +type Query { "Single line comment" - field: String + outputFieldSingle: String """ Multi line comment """ - fieldMulti: String - fieldWithArgs("Single line comment" arg1: String!, """ + outputFieldMulti: String + outputFieldWithArgs("Single line comment" arg1: SomeInput!, """ Multi line comment - """ arg2: String!): String + """ arg2: OtherInput!): String } """ @@ -36,22 +31,27 @@ type OtherObjectType implements SomeInterface & OtherInterface { fieldWithArgs(arg1: String!, arg2: String!): String } +"Single line comment" +interface OtherInterface { + field: String +} + """ Multi line comment """ -type Query { +interface SomeInterface { "Single line comment" - outputFieldSingle: String + field: String """ Multi line comment """ - outputFieldMulti: String - outputFieldWithArgs("Single line comment" arg1: SomeInput!, """ + fieldMulti: String + fieldWithArgs("Single line comment" arg1: String!, """ Multi line comment - """ arg2: OtherInput!): String + """ arg2: String!): String } "Single line comment" @@ -113,8 +113,14 @@ enum SomeEnum { VALUE2 } -"The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." -directive @oneOf on INPUT_OBJECT +""" +Multi line +comment +""" +scalar Other + +"Single line comment" +scalar Some "Single line comment" directive @other("Single line comment" arg1: String, """ @@ -130,12 +136,3 @@ directive @some("Single line comment" arg1: String, """ Multi line comment """ arg2: String) on FIELD - -""" -Multi line -comment -""" -scalar Other - -"Single line comment" -scalar Some diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/DescriptionTests.Schema_With_All_Possible_Descriptions_No_Indent.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/DescriptionTests.Schema_With_All_Possible_Descriptions_No_Indent.graphql index 1eee53226b4..a697def1429 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/DescriptionTests.Schema_With_All_Possible_Descriptions_No_Indent.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/DescriptionTests.Schema_With_All_Possible_Descriptions_No_Indent.graphql @@ -1,25 +1,25 @@ -"Single line comment" schema { query: Query } "Single line comment" interface OtherInterface { field: String } """ +"Single line comment" schema { query: Query } """ Multi line comment -""" interface SomeInterface { "Single line comment" field: String """ +""" type Query { "Single line comment" outputFieldSingle: String """ Multi line comment - """ fieldMulti: String fieldWithArgs("Single line comment" arg1: String! """ + """ outputFieldMulti: String outputFieldWithArgs("Single line comment" arg1: SomeInput! """ Multi line comment - """ arg2: String!): String } """ + """ arg2: OtherInput!): String } """ Multi line comment -""" type OtherObjectType implements SomeInterface & OtherInterface { field: String fieldMulti: String fieldWithArgs(arg1: String! arg2: String!): String } """ +""" type OtherObjectType implements SomeInterface & OtherInterface { field: String fieldMulti: String fieldWithArgs(arg1: String! arg2: String!): String } "Single line comment" interface OtherInterface { field: String } """ Multi line comment -""" type Query { "Single line comment" outputFieldSingle: String """ +""" interface SomeInterface { "Single line comment" field: String """ Multi line comment - """ outputFieldMulti: String outputFieldWithArgs("Single line comment" arg1: SomeInput! """ + """ fieldMulti: String fieldWithArgs("Single line comment" arg1: String! """ Multi line comment - """ arg2: OtherInput!): String } "Single line comment" union OtherUnion = OtherObjectType """ + """ arg2: String!): String } "Single line comment" union OtherUnion = OtherObjectType """ Multi line comment """ union SomeUnion = OtherObjectType "Single line comment" input OtherInput { "Single line comment" field: String! """ @@ -40,16 +40,16 @@ comment """ VALUE2 } "Single line comment" enum SomeEnum { "Single line comment" VALUE1 """ Multi line comment - """ VALUE2 } "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." directive @oneOf on INPUT_OBJECT "Single line comment" directive @other("Single line comment" arg1: String """ + """ VALUE2 } """ Multi line comment -""" arg2: String) on FIELD """ +""" scalar Other "Single line comment" scalar Some "Single line comment" directive @other("Single line comment" arg1: String """ Multi line comment -""" directive @some("Single line comment" arg1: String """ +""" arg2: String) on FIELD """ Multi line comment -""" arg2: String) on FIELD """ +""" directive @some("Single line comment" arg1: String """ Multi line comment -""" scalar Other "Single line comment" scalar Some +""" arg2: String) on FIELD diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/DirectiveTypeTests.AnnotationBased_Deprecated_NullableArguments_Valid.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/DirectiveTypeTests.AnnotationBased_Deprecated_NullableArguments_Valid.graphql index f04b35aad36..a5fba08c2eb 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/DirectiveTypeTests.AnnotationBased_Deprecated_NullableArguments_Valid.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/DirectiveTypeTests.AnnotationBased_Deprecated_NullableArguments_Valid.graphql @@ -8,6 +8,6 @@ type Query { directive @deprecated2( obsoleteWithReason: Int @deprecated(reason: "reason") - obsolete: Int @deprecated + obsolete: Int @deprecated(reason: "No longer supported.") deprecated: Int @deprecated(reason: "reason") ) on FIELD_DEFINITION diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/EnumTypeTests.Deprecate_Obsolete_Values.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/EnumTypeTests.Deprecate_Obsolete_Values.snap index 56a7552d5d1..6a0ead51dd5 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/EnumTypeTests.Deprecate_Obsolete_Values.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/EnumTypeTests.Deprecate_Obsolete_Values.snap @@ -1,4 +1,4 @@ -schema { +schema { query: Query } @@ -8,5 +8,5 @@ type Query { enum FooObsolete { BAR1 - BAR2 @deprecated + BAR2 @deprecated(reason: "No longer supported.") } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InputObjectTypeTests.AnnotationBased_DeprecatedInputTypes_NullableFields_Valid.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InputObjectTypeTests.AnnotationBased_DeprecatedInputTypes_NullableFields_Valid.snap index f6dd98d6819..0adbd0e5ffd 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InputObjectTypeTests.AnnotationBased_DeprecatedInputTypes_NullableFields_Valid.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InputObjectTypeTests.AnnotationBased_DeprecatedInputTypes_NullableFields_Valid.snap @@ -1,4 +1,4 @@ -schema { +schema { query: Query } @@ -8,6 +8,6 @@ type Query { input DeprecatedInputFieldsInput { obsoleteWithReason: Int @deprecated(reason: "reason") - obsolete: Int @deprecated + obsolete: Int @deprecated(reason: "No longer supported.") deprecated: Int @deprecated(reason: "reason") } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InputObjectTypeTests.Deprecate_fields_with_attribute.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InputObjectTypeTests.Deprecate_fields_with_attribute.snap index 606b67165b8..ba36023e3db 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InputObjectTypeTests.Deprecate_fields_with_attribute.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InputObjectTypeTests.Deprecate_fields_with_attribute.snap @@ -1,4 +1,4 @@ -input InputWithDeprecatedFieldInput { - a: String @deprecated +input InputWithDeprecatedFieldInput { + a: String @deprecated(reason: "No longer supported.") b: String @deprecated(reason: "Foo Bar") } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeExtensionTests.InterfaceTypeExtension_Deprecated_Directive_Is_Serialized.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeExtensionTests.InterfaceTypeExtension_Deprecated_Directive_Is_Serialized.snap index 33b7e02ab31..4f9ef92a508 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeExtensionTests.InterfaceTypeExtension_Deprecated_Directive_Is_Serialized.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeExtensionTests.InterfaceTypeExtension_Deprecated_Directive_Is_Serialized.snap @@ -1,12 +1,12 @@ -schema { +schema { query: DummyQuery } -interface Foo { - description: String! @deprecated - name(a: String!): String! -} - type DummyQuery { foo: String! } + +interface Foo { + description: String! @deprecated(reason: "No longer supported.") + name(a: String!): String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.AnnotationBased_DeprecatedArguments_Valid.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.AnnotationBased_DeprecatedArguments_Valid.snap index 3a02b61ebda..8e6821acc61 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.AnnotationBased_DeprecatedArguments_Valid.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.AnnotationBased_DeprecatedArguments_Valid.snap @@ -1,7 +1,11 @@ -schema { +schema { query: Query } +type Query { + foo: Int! +} + interface DeprecatedImplementation implements DeprecatedInterface { deprecated(deprecated: Int @deprecated(reason: "reason")): Int } @@ -9,7 +13,3 @@ interface DeprecatedImplementation implements DeprecatedInterface { interface DeprecatedInterface { deprecated(deprecated: Int @deprecated(reason: "reason")): Int } - -type Query { - foo: Int! -} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.AnnotationBased_Interface_Issue_3577.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.AnnotationBased_Interface_Issue_3577.snap index ee2a46fad3a..2ebe92dcbf2 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.AnnotationBased_Interface_Issue_3577.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.AnnotationBased_Interface_Issue_3577.snap @@ -2,8 +2,9 @@ schema { query: Query } -interface Fruit { - taste: String! +type Query { + fruits: [Fruit!]! + hello: String! } type Orange implements Fruit { @@ -16,7 +17,6 @@ type Pineapple implements Fruit { taste: String! } -type Query { - fruits: [Fruit!]! - hello: String! +interface Fruit { + taste: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.AnnotationBased_Interface_Issue_3577_Inheritance_Control.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.AnnotationBased_Interface_Issue_3577_Inheritance_Control.snap index 6bd008f59b3..51e54cf7456 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.AnnotationBased_Interface_Issue_3577_Inheritance_Control.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.AnnotationBased_Interface_Issue_3577_Inheritance_Control.snap @@ -2,18 +2,18 @@ schema { query: PetQuery } -interface Canine implements Pet { - name: String! +type PetQuery { + dog: Pet! } -interface Pet { +type Dog implements Canine & Pet { name: String! } -type Dog implements Canine & Pet { +interface Canine implements Pet { name: String! } -type PetQuery { - dog: Pet! +interface Pet { + name: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.CodeFirst_DeprecatedArguments_Valid.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.CodeFirst_DeprecatedArguments_Valid.snap index 5e038947ac9..35e387a4f5f 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.CodeFirst_DeprecatedArguments_Valid.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.CodeFirst_DeprecatedArguments_Valid.snap @@ -1,15 +1,15 @@ -schema { +schema { query: Query } -interface Interface { - bar(baz: Int @deprecated(reason: "b")): Int +type Query { + foo: Int! } type Foo implements Interface { bar(baz: Int @deprecated(reason: "b")): Int } -type Query { - foo: Int! +interface Interface { + bar(baz: Int @deprecated(reason: "b")): Int } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Deprecate_Fields_With_Deprecated_Attribute.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Deprecate_Fields_With_Deprecated_Attribute.snap index 9b199b4f42e..dc5187d81c0 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Deprecate_Fields_With_Deprecated_Attribute.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Deprecate_Fields_With_Deprecated_Attribute.snap @@ -2,11 +2,11 @@ schema { query: Query } +type Query { + foo: String +} + interface FooDeprecated { bar: String! @deprecated(reason: "Use Bar2.") bar2: String! } - -type Query { - foo: String -} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Deprecate_Obsolete_Fields.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Deprecate_Obsolete_Fields.snap index 70b1742717d..f53260e447a 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Deprecate_Obsolete_Fields.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Deprecate_Obsolete_Fields.snap @@ -2,10 +2,10 @@ schema { query: Query } -interface FooObsolete { - bar: String! @deprecated(reason: "Baz") -} - type Query { foo: String } + +interface FooObsolete { + bar: String! @deprecated(reason: "Baz") +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Ensure_Interface_Field_Is_Requested_When_Applying_NamingConvention.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Ensure_Interface_Field_Is_Requested_When_Applying_NamingConvention.snap index ca35867b46f..6b7e16036ba 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Ensure_Interface_Field_Is_Requested_When_Applying_NamingConvention.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Ensure_Interface_Field_Is_Requested_When_Applying_NamingConvention.snap @@ -2,10 +2,10 @@ schema { query: Query } -interface IFooNaming { - foo_bar_baz: String! -} - type Query { foo: IFooNaming } + +interface IFooNaming { + foo_bar_baz: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Ignore_Bar_Property.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Ignore_Bar_Property.snap index 9c23e6ac0c8..bfc098360da 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Ignore_Bar_Property.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.Ignore_Bar_Property.snap @@ -2,11 +2,11 @@ schema { query: Query } +type Query { + foo: String +} + interface IFoo { baz: String qux(a: String!): Int! } - -type Query { - foo: String -} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.SchemaFirst_DeprecatedArguments_Valid.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.SchemaFirst_DeprecatedArguments_Valid.snap index fd87e44d770..199d183995a 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.SchemaFirst_DeprecatedArguments_Valid.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.SchemaFirst_DeprecatedArguments_Valid.snap @@ -1,15 +1,15 @@ -schema { +schema { query: Query } -interface Interface { - bar(a: String @deprecated(reason: "reason")): Int! +type Query { + foo: Int! } type Foo implements Interface { bar(a: String @deprecated(reason: "reason")): Int! } -type Query { - foo: Int! +interface Interface { + bar(a: String @deprecated(reason: "reason")): Int! } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.StripLeadingIFromInterface.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.StripLeadingIFromInterface.snap index 67210a0348d..4b1131be54b 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.StripLeadingIFromInterface.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/InterfaceTypeTests.StripLeadingIFromInterface.snap @@ -2,10 +2,10 @@ schema { query: Query } -interface FooNaming { - fooBarBaz: String! -} - type Query { foo: FooNaming } + +interface FooNaming { + fooBarBaz: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectFieldExpressionTests.Infer_Field_Types_From_Expression.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectFieldExpressionTests.Infer_Field_Types_From_Expression.snap index f72bdc67e0a..c4d8a4426d8 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectFieldExpressionTests.Infer_Field_Types_From_Expression.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectFieldExpressionTests.Infer_Field_Types_From_Expression.snap @@ -1,15 +1,15 @@ -schema { +schema { query: Query } -type Bar { - text: String! - count: Int! -} - type Query { text: String! texts: [String!]! bars: [Bar!]! bar: Bar! } + +type Bar { + text: String! + count: Int! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeExtensionTests.BindByType.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeExtensionTests.BindByType.snap index 97227059a78..fac1501ab23 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeExtensionTests.BindByType.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeExtensionTests.BindByType.snap @@ -1,14 +1,14 @@ -schema { +schema { query: Query } -type Bar { - baz: String - any: String -} - type Query { foo: String any: String fooEx: Bar } + +type Bar { + baz: String + any: String +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeExtensionTests.BindByType_With_Generic_Attribute.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeExtensionTests.BindByType_With_Generic_Attribute.snap index 97227059a78..fac1501ab23 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeExtensionTests.BindByType_With_Generic_Attribute.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeExtensionTests.BindByType_With_Generic_Attribute.snap @@ -1,14 +1,14 @@ -schema { +schema { query: Query } -type Bar { - baz: String - any: String -} - type Query { foo: String any: String fooEx: Bar } + +type Bar { + baz: String + any: String +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeExtensionTests.ObjectTypeExtension_DeprecateField_Without_Reason.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeExtensionTests.ObjectTypeExtension_DeprecateField_Without_Reason.snap index 3a8b1da7ff9..aa9798706b2 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeExtensionTests.ObjectTypeExtension_DeprecateField_Without_Reason.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeExtensionTests.ObjectTypeExtension_DeprecateField_Without_Reason.snap @@ -1,8 +1,8 @@ -schema { +schema { query: Foo } type Foo { - description: String @deprecated + description: String @deprecated(reason: "No longer supported.") name(a: String): String } diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecate_Fields_With_Deprecated_Attribute.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecate_Fields_With_Deprecated_Attribute.snap index 5448927951b..aa251312f1e 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecate_Fields_With_Deprecated_Attribute.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecate_Fields_With_Deprecated_Attribute.snap @@ -2,11 +2,11 @@ schema { query: Query } +type Query { + foo: String +} + type FooDeprecated { bar: String! @deprecated(reason: "Use Bar2.") bar2: String! } - -type Query { - foo: String -} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecate_Obsolete_Fields.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecate_Obsolete_Fields.snap index bd4faa43ed0..da654b9deed 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecate_Obsolete_Fields.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecate_Obsolete_Fields.snap @@ -2,10 +2,10 @@ schema { query: Query } -type FooObsolete { - bar: String! @deprecated(reason: "Baz") -} - type Query { foo: String } + +type FooObsolete { + bar: String! @deprecated(reason: "Baz") +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecated_Field_With_Reason_Is_Serialized.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecated_Field_With_Reason_Is_Serialized.snap index ec94220d85a..bc6563d75a5 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecated_Field_With_Reason_Is_Serialized.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecated_Field_With_Reason_Is_Serialized.snap @@ -1,11 +1,11 @@ -schema { +schema { query: Query } -type Foo { - bar: String @deprecated(reason: "fooBar") -} - type Query { foo: String } + +type Foo { + bar: String @deprecated(reason: "fooBar") +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecated_Field_Without_Reason_Is_Serialized.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecated_Field_Without_Reason_Is_Serialized.snap index cf7ac9ef737..2fe9770aaf6 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecated_Field_Without_Reason_Is_Serialized.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Deprecated_Field_Without_Reason_Is_Serialized.snap @@ -1,11 +1,11 @@ -schema { +schema { query: Query } -type Foo { - bar: String @deprecated -} - type Query { foo: String } + +type Foo { + bar: String @deprecated(reason: "No longer supported.") +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Infer_List_From_Queryable.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Infer_List_From_Queryable.snap index 283af044d39..6ad468f5d1e 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Infer_List_From_Queryable.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Infer_List_From_Queryable.snap @@ -2,10 +2,10 @@ schema { query: MyListQuery } -type Bar { - baz: String! -} - type MyListQuery { list: [Bar]! } + +type Bar { + baz: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Nested_Lists_With_Code_First.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Nested_Lists_With_Code_First.snap index b1e59e1d94d..dbbaddfcfd3 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Nested_Lists_With_Code_First.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Nested_Lists_With_Code_First.snap @@ -2,10 +2,10 @@ schema { query: QueryWithNestedList } -type FooIgnore { - baz: String! -} - type QueryWithNestedList { fooMatrix: [[FooIgnore!]!]! } + +type FooIgnore { + baz: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.ObjectType_From_Dictionary.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.ObjectType_From_Dictionary.snap index 7781bd3bd5d..d088a842679 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.ObjectType_From_Dictionary.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.ObjectType_From_Dictionary.snap @@ -2,14 +2,14 @@ schema { query: FooWithDict } -type Bar { - baz: String! -} - type FooWithDict { map: [KeyValuePairOfStringAndBar!]! } +type Bar { + baz: String! +} + type KeyValuePairOfStringAndBar { key: String! value: Bar! diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Static_Field_Inference_5.graphql b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Static_Field_Inference_5.graphql index 2b577214f77..ac0050f20d8 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Static_Field_Inference_5.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/ObjectTypeTests.Static_Field_Inference_5.graphql @@ -2,12 +2,12 @@ schema { query: Query } +type Query { + book: Book! +} + type Book { id: Int! title: String! isComic: Boolean! } - -type Query { - book: Book! -} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/OneOfIntegrationTests.OneOf_DefaultValue_On_Directive_Argument.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/OneOfIntegrationTests.OneOf_DefaultValue_On_Directive_Argument.snap index 81ca6d852c7..14878637288 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/OneOfIntegrationTests.OneOf_DefaultValue_On_Directive_Argument.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/OneOfIntegrationTests.OneOf_DefaultValue_On_Directive_Argument.snap @@ -12,6 +12,3 @@ input DefaultValueInput @oneOf { } directive @defaultValue(value: DefaultValueInput) on FIELD_DEFINITION - -"The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." -directive @oneOf on INPUT_OBJECT diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/OneOfIntegrationTests.OneOf_DefaultValue_On_Directive_Argument_Fluent.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/OneOfIntegrationTests.OneOf_DefaultValue_On_Directive_Argument_Fluent.snap index f99c860b948..b19e24f8c3b 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/OneOfIntegrationTests.OneOf_DefaultValue_On_Directive_Argument_Fluent.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/OneOfIntegrationTests.OneOf_DefaultValue_On_Directive_Argument_Fluent.snap @@ -12,6 +12,3 @@ input DefaultValue @oneOf { } directive @defaultValue(value: DefaultValue) on FIELD_DEFINITION - -"The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." -directive @oneOf on INPUT_OBJECT diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/OneOfIntegrationTests.OneOf_generic_code_first_schema.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/OneOfIntegrationTests.OneOf_generic_code_first_schema.snap index 585fbb53ec9..c5774dd11fd 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/OneOfIntegrationTests.OneOf_generic_code_first_schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/OneOfIntegrationTests.OneOf_generic_code_first_schema.snap @@ -10,6 +10,3 @@ input Example2Input @oneOf { a: String b: Int } - -"The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." -directive @oneOf on INPUT_OBJECT diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/SubscriptionTypeTests.Arguments_Can_Be_Declared_On_The_Stream_Schema.md b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/SubscriptionTypeTests.Arguments_Can_Be_Declared_On_The_Stream_Schema.md index 62194eb1e65..684a85278b7 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/SubscriptionTypeTests.Arguments_Can_Be_Declared_On_The_Stream_Schema.md +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/SubscriptionTypeTests.Arguments_Can_Be_Declared_On_The_Stream_Schema.md @@ -6,6 +6,10 @@ schema { subscription: MySubscription } +type Query { + a: String +} + type MySubscription { onMessage(userId: String!): String! onSysMessage: String! @@ -17,8 +21,4 @@ type MySubscription { onExplicitSync: String! onArguments(arg: String!): String! } - -type Query { - a: String -} ``` diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/SubscriptionTypeTests.Subscribe_Attribute_Schema_Is_Generated_Correctly.md b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/SubscriptionTypeTests.Subscribe_Attribute_Schema_Is_Generated_Correctly.md index 57b45518cc8..f9d8ca2d79a 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/SubscriptionTypeTests.Subscribe_Attribute_Schema_Is_Generated_Correctly.md +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/SubscriptionTypeTests.Subscribe_Attribute_Schema_Is_Generated_Correctly.md @@ -7,6 +7,10 @@ schema { subscription: MySubscription } +type Query { + a: String +} + type MyMutation { writeBoolean(userId: String!, message: Boolean!): Boolean! writeMessage(userId: String!, message: String!): String! @@ -27,8 +31,4 @@ type MySubscription { onExplicitSync: String! onArguments(arg: String!): String! } - -type Query { - a: String -} ``` diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/TypeFactoryTests.CreateInterfaceType.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/TypeFactoryTests.CreateInterfaceType.snap index 23adac5a151..90b1342e8bc 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/TypeFactoryTests.CreateInterfaceType.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/TypeFactoryTests.CreateInterfaceType.snap @@ -2,11 +2,11 @@ schema { query: DummyQuery } +type DummyQuery { + bar: String! +} + interface Simple { a: String b: [String] } - -type DummyQuery { - bar: String! -} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/TypeFactoryTests.InterfaceFieldDeprecationReason.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/TypeFactoryTests.InterfaceFieldDeprecationReason.snap index cf236fbf07d..69942b881a2 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/TypeFactoryTests.InterfaceFieldDeprecationReason.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/TypeFactoryTests.InterfaceFieldDeprecationReason.snap @@ -2,10 +2,10 @@ schema { query: DummyQuery } -interface Simple { - a: String @deprecated(reason: "reason123") -} - type DummyQuery { bar: String! } + +interface Simple { + a: String @deprecated(reason: "reason123") +} diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/TypeFactoryTests.InterfaceFieldDeprecationWithoutReason.snap b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/TypeFactoryTests.InterfaceFieldDeprecationWithoutReason.snap index 9afa98969c4..0aceee73f1d 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/TypeFactoryTests.InterfaceFieldDeprecationWithoutReason.snap +++ b/src/HotChocolate/Core/test/Types.Tests/Types/__snapshots__/TypeFactoryTests.InterfaceFieldDeprecationWithoutReason.snap @@ -2,10 +2,10 @@ schema { query: DummyQuery } -interface Simple { - a: String @deprecated -} - type DummyQuery { bar: String! } + +interface Simple { + a: String @deprecated(reason: "No longer supported.") +} diff --git a/src/HotChocolate/Core/test/Types.Tests/__resources__/serialize_schema.graphql b/src/HotChocolate/Core/test/Types.Tests/__resources__/serialize_schema.graphql deleted file mode 100644 index 6003f7799b0..00000000000 --- a/src/HotChocolate/Core/test/Types.Tests/__resources__/serialize_schema.graphql +++ /dev/null @@ -1,17 +0,0 @@ -type Foo implements Bar { - id: ID! -} - -interface Bar { - id: ID! @upper -} - -type Baz { - name(baz: BazInput): String -} - -union FooOrBaz = Foo | Baz - -input BazInput { - name: String -} diff --git a/src/HotChocolate/Core/test/Types.Tests/__resources__/serialize_schema_with_mutation.graphql b/src/HotChocolate/Core/test/Types.Tests/__resources__/serialize_schema_with_mutation.graphql deleted file mode 100644 index 9794e9a72c4..00000000000 --- a/src/HotChocolate/Core/test/Types.Tests/__resources__/serialize_schema_with_mutation.graphql +++ /dev/null @@ -1,25 +0,0 @@ -type Query { - foo: Foo -} - -type Mutation { - mutate: String -} - -type Foo implements Bar { - id: ID! -} - -interface Bar { - id: ID! -} - -type Baz { - name("some comment" baz: BazInput): String -} - -union FooOrBaz = Foo | Baz - -input BazInput { - name: String -} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Change_DefaultBinding_For_DateTime.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Change_DefaultBinding_For_DateTime.snap index 97f2ed9bf8b..77a96ad0ce5 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Change_DefaultBinding_For_DateTime.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Change_DefaultBinding_For_DateTime.snap @@ -2,20 +2,14 @@ schema { query: QueryWithDateTime } -type ModelWithDateTime { - foo: Date - bar: DateTime! -} - type QueryWithDateTime { model: ModelWithDateTime } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR +type ModelWithDateTime { + foo: Date + bar: DateTime! +} "The `Date` scalar type represents a date in UTC." scalar Date diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Comparison_Is_Ignored.graphql b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Comparison_Is_Ignored.graphql index 91eb3eac414..31afcd28fbc 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Comparison_Is_Ignored.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Comparison_Is_Ignored.graphql @@ -2,14 +2,14 @@ schema { query: QueryComparableEntity } -type ComparableExample { - some: String! -} - type QueryComparableEntity { foo(example: ComparableExampleInput!): ComparableExample! } +type ComparableExample { + some: String! +} + input ComparableExampleInput { some: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Default_Type_Resolution_Shall_Be_Exact_Schema.graphql b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Default_Type_Resolution_Shall_Be_Exact_Schema.graphql index a255686f701..1054529dab1 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Default_Type_Resolution_Shall_Be_Exact_Schema.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Default_Type_Resolution_Shall_Be_Exact_Schema.graphql @@ -2,8 +2,9 @@ schema { query: Query } -interface IPet { - name: String +type Query { + shouldBeCat: IPet + shouldBeDog: IPet } type Cat implements IPet { @@ -14,7 +15,6 @@ type Dog implements IPet { name: String } -type Query { - shouldBeCat: IPet - shouldBeDog: IPet +interface IPet { + name: String } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.InferSchemaWithNonNullRefTypes.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.InferSchemaWithNonNullRefTypes.snap index a1cc60a01d1..4507119e33c 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.InferSchemaWithNonNullRefTypes.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.InferSchemaWithNonNullRefTypes.snap @@ -2,8 +2,11 @@ schema { query: Query } -interface IPet { - name: String +type Query { + sayHello(name: String!): String! + greetings(greetings: GreetingsInput!): Greetings! + pet: IPet! + petOrNull: IPet } type Dog implements IPet { @@ -14,11 +17,8 @@ type Greetings { name: String! } -type Query { - sayHello(name: String!): String! - greetings(greetings: GreetingsInput!): Greetings! - pet: IPet! - petOrNull: IPet +interface IPet { + name: String } input GreetingsInput { diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.InferSchemaWithNonNullRefTypesAndGenerics.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.InferSchemaWithNonNullRefTypesAndGenerics.snap index 2a6395897ce..b04ceec866b 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.InferSchemaWithNonNullRefTypesAndGenerics.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.InferSchemaWithNonNullRefTypesAndGenerics.snap @@ -2,18 +2,6 @@ schema { query: QueryWithGenerics } -interface IPet { - name: String -} - -type Dog implements IPet { - name: String -} - -type GenericWrapperOfIPet { - value: IPet! -} - type QueryWithGenerics { pet(id: Int!): IPet pets( @@ -26,6 +14,18 @@ type QueryWithGenerics { ): GenericWrapperOfIPet! } +type Dog implements IPet { + name: String +} + +type GenericWrapperOfIPet { + value: IPet! +} + +interface IPet { + name: String +} + input GenericWrapperOfStringInput { value: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Infer_Interface_Usage.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Infer_Interface_Usage.snap index c3b9cd6e4b9..52253cb54d2 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Infer_Interface_Usage.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Infer_Interface_Usage.snap @@ -2,8 +2,8 @@ schema { query: QueryInterfaces } -interface IFoo { - foo: String! +type QueryInterfaces { + foo: IFoo! } type Foo implements IFoo { @@ -11,6 +11,6 @@ type Foo implements IFoo { foo: String! } -type QueryInterfaces { - foo: IFoo! +interface IFoo { + foo: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Infer_Interface_Usage_With_Interfaces_Implementing_Interfaces.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Infer_Interface_Usage_With_Interfaces_Implementing_Interfaces.snap index 7fe2a2c870c..81abc7a4afc 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Infer_Interface_Usage_With_Interfaces_Implementing_Interfaces.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Infer_Interface_Usage_With_Interfaces_Implementing_Interfaces.snap @@ -2,20 +2,20 @@ schema { query: QueryInterfaces } -interface IBar { - bar: String! +type QueryInterfaces { + foo: IFoo! } -interface IFoo implements IBar { - foo: String! +type Foo implements IFoo & IBar { bar: String! + foo: String! } -type Foo implements IFoo & IBar { +interface IBar { bar: String! - foo: String! } -type QueryInterfaces { - foo: IFoo! +interface IFoo implements IBar { + foo: String! + bar: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Infer_Nullability_From_Nested_Classes.graphql b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Infer_Nullability_From_Nested_Classes.graphql index 9b496497145..99db5d71db7 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Infer_Nullability_From_Nested_Classes.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Infer_Nullability_From_Nested_Classes.graphql @@ -2,6 +2,10 @@ schema { query: QueryNestedClassNullableString } +type QueryNestedClassNullableString { + nestedClassNullableString: Example! +} + type Example { inner: Inner! outer: Outer! @@ -14,7 +18,3 @@ type Inner { type Outer { shouldBeNullable: String! } - -type QueryNestedClassNullableString { - nestedClassNullableString: Example! -} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Structural_Equality_Is_Ignored.graphql b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Structural_Equality_Is_Ignored.graphql index 9b7fdf54d7b..74f4fe20576 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Structural_Equality_Is_Ignored.graphql +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Structural_Equality_Is_Ignored.graphql @@ -2,14 +2,14 @@ schema { query: QueryStructEquals } -type EquatableExample { - some: String! -} - type QueryStructEquals { foo(example: EquatableExampleInput!): EquatableExample! } +type EquatableExample { + some: String! +} + input EquatableExampleInput { some: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Type_Is_Correctly_Upgraded.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Type_Is_Correctly_Upgraded.snap index 22e5c0ae4f4..188cc4aef77 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Type_Is_Correctly_Upgraded.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/CodeFirstTests.Type_Is_Correctly_Upgraded.snap @@ -2,8 +2,11 @@ schema { query: Query } -interface IPet { - name: String +type Query { + sayHello(name: String!): String! + greetings(greetings: GreetingsInput!): Greetings! + pet: IPet! + petOrNull: IPet } type Dog implements IPet { @@ -15,11 +18,8 @@ type Greetings { name: String! } -type Query { - sayHello(name: String!): String! - greetings(greetings: GreetingsInput!): Greetings! - pet: IPet! - petOrNull: IPet +interface IPet { + name: String } input GreetingsInput { diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GenericTypeNamingTests.NamingResolution.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GenericTypeNamingTests.NamingResolution.snap index 620c222ac61..34e5928b7ca 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GenericTypeNamingTests.NamingResolution.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GenericTypeNamingTests.NamingResolution.snap @@ -1,7 +1,23 @@ -schema { +schema { query: Query } +type Query { + oneGenericType: TupleOfInt32! + twoGenericsType: TupleOfInt32AndInt32! + threeGenericsType: TupleOfInt32AndInt32AndInt32! + fourGenericsType: TupleOfInt32AndInt32AndInt32AndInt32! + fiveGenericTypes: TupleOfInt32AndInt32AndInt32AndInt32AndInt32! + sixGenericTypes: TupleOfInt32AndInt32AndInt32AndInt32AndInt32AndInt32! + sevenGenericTypes: TupleOfInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32! + eightGenericTypes: EightElementsTupleOfInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32! + nineGenericTypes: NineElementsTupleOfInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32! + tenGenericTypes: TenElementsTupleOfInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32! + intBar: BarOfInt32! + stringBar: BarOfString! + customNameBar: BarOfMyType! +} + type BarOfInt32 { test: Int! } @@ -41,22 +57,6 @@ type NineElementsTupleOfInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32And item7: Int! } -type Query { - oneGenericType: TupleOfInt32! - twoGenericsType: TupleOfInt32AndInt32! - threeGenericsType: TupleOfInt32AndInt32AndInt32! - fourGenericsType: TupleOfInt32AndInt32AndInt32AndInt32! - fiveGenericTypes: TupleOfInt32AndInt32AndInt32AndInt32AndInt32! - sixGenericTypes: TupleOfInt32AndInt32AndInt32AndInt32AndInt32AndInt32! - sevenGenericTypes: TupleOfInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32! - eightGenericTypes: EightElementsTupleOfInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32! - nineGenericTypes: NineElementsTupleOfInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32! - tenGenericTypes: TenElementsTupleOfInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32! - intBar: BarOfInt32! - stringBar: BarOfString! - customNameBar: BarOfMyType! -} - type TenElementsTupleOfInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32AndInt32 { item10: Int! item9: Int! diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteFirstToNonNull_When_NoParametersAreSet.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteFirstToNonNull_When_NoParametersAreSet.snap index f236b22604d..7d04981cb88 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteFirstToNonNull_When_NoParametersAreSet.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteFirstToNonNull_When_NoParametersAreSet.snap @@ -1,11 +1,7 @@ -schema { +schema { query: Query } -type Foo { - bar: String! -} - type Query { scalar: String! scalarArray: [String]! @@ -14,3 +10,7 @@ type Query { objectArray: [Foo]! objectNestedArray: [[Foo]]! } + +type Foo { + bar: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteFirstToNonNull_When_RequiredAndTypeIsSet.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteFirstToNonNull_When_RequiredAndTypeIsSet.snap index d239372a7b5..1fe9711dcfc 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteFirstToNonNull_When_RequiredAndTypeIsSet.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteFirstToNonNull_When_RequiredAndTypeIsSet.snap @@ -1,11 +1,7 @@ -schema { +schema { query: QueryRequiredWithType } -type CustomType { - bar: Int! -} - type QueryRequiredWithType { scalar: ID scalarArray: [ID] @@ -14,3 +10,7 @@ type QueryRequiredWithType { objectArray: [CustomType] objectNestedArray: [[CustomType]] } + +type CustomType { + bar: Int! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteFirstToNonNull_When_RequiredIsSet.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteFirstToNonNull_When_RequiredIsSet.snap index 84d85a30005..a7be4a4eb79 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteFirstToNonNull_When_RequiredIsSet.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteFirstToNonNull_When_RequiredIsSet.snap @@ -1,11 +1,7 @@ -schema { +schema { query: QueryRequired } -type Foo { - bar: String! -} - type QueryRequired { scalar: String! scalarArray: [String]! @@ -14,3 +10,7 @@ type QueryRequired { objectArray: [Foo]! objectNestedArray: [[Foo]]! } + +type Foo { + bar: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteToNonNull_When_GraphQLTypeIsUsed.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteToNonNull_When_GraphQLTypeIsUsed.snap index 510a2a32f34..b59c3730baa 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteToNonNull_When_GraphQLTypeIsUsed.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteToNonNull_When_GraphQLTypeIsUsed.snap @@ -1,11 +1,7 @@ -schema { +schema { query: QueryDeepWithType } -type CustomType { - bar: Int! -} - type QueryDeepWithType { scalar: ID! scalarArray: [ID!]! @@ -14,3 +10,7 @@ type QueryDeepWithType { objectArray: [CustomType!]! objectNestedArray: [[CustomType!]!]! } + +type CustomType { + bar: Int! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteToNonNull_When_ParametersAreSet.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteToNonNull_When_ParametersAreSet.snap index 763d63e1ab6..0a06cd29e27 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteToNonNull_When_ParametersAreSet.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/GraphQLNonNullTypeTests.GraphQLNonNull_Should_RewriteToNonNull_When_ParametersAreSet.snap @@ -1,11 +1,7 @@ -schema { +schema { query: QueryDeep } -type Foo { - bar: String! -} - type QueryDeep { scalar: String! scalarArray: [String!]! @@ -14,3 +10,7 @@ type QueryDeep { objectArray: [Foo!]! objectNestedArray: [[Foo!]!]! } + +type Foo { + bar: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/IgnoreTests.IgnoreOutputField.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/IgnoreTests.IgnoreOutputField.snap index 1bb416e9dd8..ccf3d4bef6a 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/IgnoreTests.IgnoreOutputField.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/IgnoreTests.IgnoreOutputField.snap @@ -1,11 +1,11 @@ -schema { +schema { query: Query } -type Bar { - baz: String! -} - type Query { bar: Bar! } + +type Bar { + baz: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/NamingConventionTests.PureCodeFirst_NamingConvention_RenameArgument.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/NamingConventionTests.PureCodeFirst_NamingConvention_RenameArgument.snap index e6d637f084d..3b63d450bef 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/NamingConventionTests.PureCodeFirst_NamingConvention_RenameArgument.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/NamingConventionTests.PureCodeFirst_NamingConvention_RenameArgument.snap @@ -3,6 +3,17 @@ schema { mutation: MutationNamingConvention_Named } +"GetTypeDescription" +type QueryNamingConvention_Named { + "GetMemberDescription" + queryField_Named( + "GetArgumentDescription" + queryArgument_Named: Int! + "GetArgumentDescription" + complexArgument_Named: InputObjectNamingConventionInput_Named! + ): ObjectNamingConvention_Named! +} + "GetTypeDescription" type MutationNamingConvention_Named { "GetMemberDescription" @@ -20,17 +31,6 @@ type ObjectNamingConvention_Named { outputField_Named: String! } -"GetTypeDescription" -type QueryNamingConvention_Named { - "GetMemberDescription" - queryField_Named( - "GetArgumentDescription" - queryArgument_Named: Int! - "GetArgumentDescription" - complexArgument_Named: InputObjectNamingConventionInput_Named! - ): ObjectNamingConvention_Named! -} - "GetTypeDescription" input InputObjectNamingConventionInput_Named { "GetMemberDescription" diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/NamingConventionTests.PureCodeFirst_NamingConvention_RenameArgument_RequestBuilder.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/NamingConventionTests.PureCodeFirst_NamingConvention_RenameArgument_RequestBuilder.snap index e6d637f084d..3b63d450bef 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/NamingConventionTests.PureCodeFirst_NamingConvention_RenameArgument_RequestBuilder.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/NamingConventionTests.PureCodeFirst_NamingConvention_RenameArgument_RequestBuilder.snap @@ -3,6 +3,17 @@ schema { mutation: MutationNamingConvention_Named } +"GetTypeDescription" +type QueryNamingConvention_Named { + "GetMemberDescription" + queryField_Named( + "GetArgumentDescription" + queryArgument_Named: Int! + "GetArgumentDescription" + complexArgument_Named: InputObjectNamingConventionInput_Named! + ): ObjectNamingConvention_Named! +} + "GetTypeDescription" type MutationNamingConvention_Named { "GetMemberDescription" @@ -20,17 +31,6 @@ type ObjectNamingConvention_Named { outputField_Named: String! } -"GetTypeDescription" -type QueryNamingConvention_Named { - "GetMemberDescription" - queryField_Named( - "GetArgumentDescription" - queryArgument_Named: Int! - "GetArgumentDescription" - complexArgument_Named: InputObjectNamingConventionInput_Named! - ): ObjectNamingConvention_Named! -} - "GetTypeDescription" input InputObjectNamingConventionInput_Named { "GetMemberDescription" diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Abstract_Classes_Are_Allowed_As_Object_Types.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Abstract_Classes_Are_Allowed_As_Object_Types.snap index 9bf134c6271..3c0bd5dd91a 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Abstract_Classes_Are_Allowed_As_Object_Types.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Abstract_Classes_Are_Allowed_As_Object_Types.snap @@ -2,11 +2,11 @@ schema { query: AbstractQuery } -type AbstractChild { +type AbstractQuery { foo: String! + object: AbstractChild! } -type AbstractQuery { +type AbstractChild { foo: String! - object: AbstractChild! } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddMutationType.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddMutationType.snap index 80dc7c8fdb9..f68d37c94fd 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddMutationType.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddMutationType.snap @@ -3,14 +3,14 @@ schema { mutation: Foo } -type Bar { - baz: String! +type Query { + foo: String } type Foo { bar: Bar! } -type Query { - foo: String +type Bar { + baz: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddMutationType_Generic.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddMutationType_Generic.snap index 80dc7c8fdb9..f68d37c94fd 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddMutationType_Generic.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddMutationType_Generic.snap @@ -3,14 +3,14 @@ schema { mutation: Foo } -type Bar { - baz: String! +type Query { + foo: String } type Foo { bar: Bar! } -type Query { - foo: String +type Bar { + baz: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddMutationType_GenericClr.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddMutationType_GenericClr.snap index 80dc7c8fdb9..f68d37c94fd 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddMutationType_GenericClr.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddMutationType_GenericClr.snap @@ -3,14 +3,14 @@ schema { mutation: Foo } -type Bar { - baz: String! +type Query { + foo: String } type Foo { bar: Bar! } -type Query { - foo: String +type Bar { + baz: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddQueryType.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddQueryType.snap index 0ad25fb4aa2..11420c063c2 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddQueryType.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddQueryType.snap @@ -2,10 +2,10 @@ schema { query: Foo } -type Bar { - baz: String! -} - type Foo { bar: Bar! } + +type Bar { + baz: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddQueryType_Generic.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddQueryType_Generic.snap index 0ad25fb4aa2..11420c063c2 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddQueryType_Generic.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddQueryType_Generic.snap @@ -2,10 +2,10 @@ schema { query: Foo } -type Bar { - baz: String! -} - type Foo { bar: Bar! } + +type Bar { + baz: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddQueryType_GenericClr.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddQueryType_GenericClr.snap index 0ad25fb4aa2..11420c063c2 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddQueryType_GenericClr.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddQueryType_GenericClr.snap @@ -2,10 +2,10 @@ schema { query: Foo } -type Bar { - baz: String! -} - type Foo { bar: Bar! } + +type Bar { + baz: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddSubscriptionType.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddSubscriptionType.snap index 3df62be4e3d..325c5cf59d8 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddSubscriptionType.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddSubscriptionType.snap @@ -3,14 +3,14 @@ schema { subscription: Foo } -type Bar { - baz: String! +type Query { + foo: String } type Foo { bar: Bar! } -type Query { - foo: String +type Bar { + baz: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddSubscriptionType_Generic.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddSubscriptionType_Generic.snap index 3df62be4e3d..325c5cf59d8 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddSubscriptionType_Generic.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddSubscriptionType_Generic.snap @@ -3,14 +3,14 @@ schema { subscription: Foo } -type Bar { - baz: String! +type Query { + foo: String } type Foo { bar: Bar! } -type Query { - foo: String +type Bar { + baz: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddSubscriptionType_GenericClr.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddSubscriptionType_GenericClr.snap index 3df62be4e3d..325c5cf59d8 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddSubscriptionType_GenericClr.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.AddSubscriptionType_GenericClr.snap @@ -3,14 +3,14 @@ schema { subscription: Foo } -type Bar { - baz: String! +type Query { + foo: String } type Foo { bar: Bar! } -type Query { - foo: String +type Bar { + baz: String! } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Create_SingleType.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Create_SingleType.snap index 0ad25fb4aa2..11420c063c2 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Create_SingleType.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Create_SingleType.snap @@ -2,10 +2,10 @@ schema { query: Foo } -type Bar { - baz: String! -} - type Foo { bar: Bar! } + +type Bar { + baz: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Dynamic_Types_Are_Integrated.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Dynamic_Types_Are_Integrated.snap index 5ec38ba6be9..29219fd01e2 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Dynamic_Types_Are_Integrated.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Dynamic_Types_Are_Integrated.snap @@ -1,11 +1,11 @@ -schema { +schema { query: Query } -type MyFoo { - bar: String -} - type Query { foo: MyFoo } + +type MyFoo { + bar: String +} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.InferMutationType.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.InferMutationType.snap index caf25e29b73..9d8d2809905 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.InferMutationType.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.InferMutationType.snap @@ -1,12 +1,12 @@ -schema { +schema { query: Query mutation: Mutation } -type Mutation { - bar: Int -} - type Query { foo: String } + +type Mutation { + bar: Int +} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Interface_Without_Implementation_But_Not_Used.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Interface_Without_Implementation_But_Not_Used.snap index 43cc4da395a..cfe11616048 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Interface_Without_Implementation_But_Not_Used.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.Interface_Without_Implementation_But_Not_Used.snap @@ -1,15 +1,15 @@ -schema { +schema { query: Query } -interface Bar { - baz: String +type Query { + foo: Baz } type Baz { baz: String } -type Query { - foo: Baz +interface Bar { + baz: String } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.UseFirstRegisteredDynamicType.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.UseFirstRegisteredDynamicType.snap index 69c2848a2b8..4f52c83ceb2 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.UseFirstRegisteredDynamicType.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaBuilderTests.UseFirstRegisteredDynamicType.snap @@ -1,7 +1,11 @@ -schema { +schema { query: Query } +type Query { + foo: MyFoo +} + type MyBar { bar: String } @@ -9,7 +13,3 @@ type MyBar { type MyFoo { bar: String } - -type Query { - foo: MyFoo -} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.BuiltInScalarsAreRecognized2.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.BuiltInScalarsAreRecognized2.snap index af802041f3f..f66c3338aa7 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.BuiltInScalarsAreRecognized2.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.BuiltInScalarsAreRecognized2.snap @@ -1,7 +1,11 @@ -schema { +schema { query: Query } +type Query { + foo: Foo +} + type Foo { string_field: String string_non_null_field: String! @@ -12,7 +16,3 @@ type Foo { bool_field: Boolean bool_non_null_field: Boolean! } - -type Query { - foo: Foo -} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.Execute_Against_Schema_With_Interface_Schema.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.Execute_Against_Schema_With_Interface_Schema.snap index 7aa4d77dcf9..b43aabf239d 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.Execute_Against_Schema_With_Interface_Schema.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.Execute_Against_Schema_With_Interface_Schema.snap @@ -1,9 +1,9 @@ -schema { +schema { query: Query } -interface Pet { - name: String +type Query { + pet: Pet } type Cat implements Pet { @@ -14,6 +14,6 @@ type Dog implements Pet { name: String } -type Query { - pet: Pet +interface Pet { + name: String } diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.ListTypesAreRecognized.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.ListTypesAreRecognized.snap index 145535c1483..cf878218124 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.ListTypesAreRecognized.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.ListTypesAreRecognized.snap @@ -1,7 +1,11 @@ -schema { +schema { query: Query } +type Query { + foo: Foo +} + type Foo { single_int: Int list_int: [Int] @@ -10,7 +14,3 @@ type Foo { nullable_list_int: [Int!]! nullable_matrix_int: [[Int!]!]! } - -type Query { - foo: Foo -} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.Reference_Schema_First_Types_From_Code_First_Models.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.Reference_Schema_First_Types_From_Code_First_Models.snap index 4dae4eaaa8e..172263cd900 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.Reference_Schema_First_Types_From_Code_First_Models.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.Reference_Schema_First_Types_From_Code_First_Models.snap @@ -1,11 +1,11 @@ -schema { +schema { query: QueryCodeFirst } -type Person { - name: String! -} - type QueryCodeFirst { person: Person! } + +type Person { + name: String! +} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_OffsetPaging.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_OffsetPaging.snap index 80ba4b7d2a8..90a2212a1a0 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_OffsetPaging.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_OffsetPaging.snap @@ -2,6 +2,10 @@ schema { query: Query } +type Query { + items(skip: Int, take: Int): ItemsCollectionSegment +} + "Information about the offset pagination." type CollectionSegmentInfo { "Indicates whether more items exist following the set defined by the clients arguments." @@ -17,7 +21,3 @@ type ItemsCollectionSegment { "A flattened list of the items." items: [String!] } - -type Query { - items(skip: Int, take: Int): ItemsCollectionSegment -} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_Paging.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_Paging.snap index d3071c63718..b876fa62f5f 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_Paging.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_Paging.snap @@ -2,6 +2,19 @@ schema { query: Query } +type Query { + items( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): ItemsConnection +} + "A connection to a list of items." type ItemsConnection { "Information to aid in pagination." @@ -31,16 +44,3 @@ type PageInfo { "When paginating forwards, the cursor to continue." endCursor: String } - -type Query { - items( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): ItemsConnection -} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_Paging_With_Objects.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_Paging_With_Objects.snap index d7469af9941..1ff763453b9 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_Paging_With_Objects.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_Paging_With_Objects.snap @@ -2,6 +2,19 @@ schema { query: Query } +type Query { + items( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): ItemsConnection +} + "A connection to a list of items." type ItemsConnection { "Information to aid in pagination." @@ -35,16 +48,3 @@ type PageInfo { type Person { name: String } - -type Query { - items( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): ItemsConnection -} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_Paging_With_Resolver.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_Paging_With_Resolver.snap index d3071c63718..b876fa62f5f 100644 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_Paging_With_Resolver.snap +++ b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaFirstTests.SchemaFirst_Cursor_Paging_With_Resolver.snap @@ -2,6 +2,19 @@ schema { query: Query } +type Query { + items( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): ItemsConnection +} + "A connection to a list of items." type ItemsConnection { "Information to aid in pagination." @@ -31,16 +44,3 @@ type PageInfo { "When paginating forwards, the cursor to continue." endCursor: String } - -type Query { - items( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): ItemsConnection -} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeAsync_Serialize.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeAsync_Serialize.snap deleted file mode 100644 index 9819fe502a4..00000000000 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeAsync_Serialize.snap +++ /dev/null @@ -1,7 +0,0 @@ -schema { - query: Query -} - -type Query { - foo: String -} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeSchemaWithDirective.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeSchemaWithDirective.snap deleted file mode 100644 index 6c1dea33084..00000000000 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeSchemaWithDirective.snap +++ /dev/null @@ -1,19 +0,0 @@ -interface Bar { - id: ID! @upper -} - -type Baz { - name(baz: BazInput): String -} - -type Foo implements Bar { - id: ID! -} - -union FooOrBaz = Foo | Baz - -input BazInput { - name: String -} - -directive @upper on FIELD_DEFINITION diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeSchemaWithMutationWithoutSubscription.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeSchemaWithMutationWithoutSubscription.snap deleted file mode 100644 index e3acac86770..00000000000 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeSchemaWithMutationWithoutSubscription.snap +++ /dev/null @@ -1,30 +0,0 @@ -schema { - query: Query - mutation: Mutation -} - -interface Bar { - id: ID! -} - -type Baz { - name("some comment" baz: BazInput): String -} - -type Foo implements Bar { - id: ID! -} - -type Mutation { - mutate: String -} - -type Query { - foo: Foo -} - -union FooOrBaz = Foo | Baz - -input BazInput { - name: String -} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeSchemaWriter_Serialize.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeSchemaWriter_Serialize.snap deleted file mode 100644 index 9819fe502a4..00000000000 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeSchemaWriter_Serialize.snap +++ /dev/null @@ -1,7 +0,0 @@ -schema { - query: Query -} - -type Query { - foo: String -} diff --git a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeTypes.snap b/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeTypes.snap deleted file mode 100644 index 5837265fc5c..00000000000 --- a/src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaSerializerTests.SerializeTypes.snap +++ /dev/null @@ -1,3 +0,0 @@ -type Query { - foo: Foo -} diff --git a/src/HotChocolate/CostAnalysis/src/CostAnalysis/CostSchemaDocumentFormatter.cs b/src/HotChocolate/CostAnalysis/src/CostAnalysis/CostSchemaDocumentFormatter.cs index 5e697d1f5ad..467777eeec0 100644 --- a/src/HotChocolate/CostAnalysis/src/CostAnalysis/CostSchemaDocumentFormatter.cs +++ b/src/HotChocolate/CostAnalysis/src/CostAnalysis/CostSchemaDocumentFormatter.cs @@ -2,9 +2,9 @@ namespace HotChocolate.CostAnalysis; -internal sealed class CostSchemaDocumentFormatter(ISchemaDefinition schema) : ISchemaDocumentFormatter +internal sealed class CostSchemaDocumentFormatter : ISchemaDocumentFormatter { - public DocumentNode Format(DocumentNode schemaDocument) + public DocumentNode Format(ISchemaDefinition schema, DocumentNode schemaDocument) { var rewriter = new CostSyntaxRewriter(); return (DocumentNode)rewriter.Rewrite(schemaDocument, new CostSyntaxRewriter.Context(schema))!; diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/CostSyntaxRewriterTests.Rewrite_DefaultWeights_RemovesCostDirectives.graphql b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/CostSyntaxRewriterTests.Rewrite_DefaultWeights_RemovesCostDirectives.graphql index 88fa710dc6f..f94509f1788 100644 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/CostSyntaxRewriterTests.Rewrite_DefaultWeights_RemovesCostDirectives.graphql +++ b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/CostSyntaxRewriterTests.Rewrite_DefaultWeights_RemovesCostDirectives.graphql @@ -2,6 +2,10 @@ schema { query: Query } +type Query { + compositeField(inputArg: Input, listArg: [Scalar], scalarArg: Scalar): CompositeType +} + type CompositeType { listField: [ElementType] } @@ -10,10 +14,6 @@ type ElementType { scalarField: Scalar } -type Query { - compositeField(inputArg: Input, listArg: [Scalar], scalarArg: Scalar): CompositeType -} - input Input { inputField: Input listField: [Scalar] @@ -24,10 +24,10 @@ enum Enum { ENUM_VALUE } +scalar Scalar + "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." directive @cost( "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." weight: String! ) on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | ENUM | INPUT_FIELD_DEFINITION - -scalar Scalar diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/CostSyntaxRewriterTests.Rewrite_NonDefaultWeights_DoesNotRemoveCostDirectives.graphql b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/CostSyntaxRewriterTests.Rewrite_NonDefaultWeights_DoesNotRemoveCostDirectives.graphql index 4ba6725bb8b..75fce81b1aa 100644 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/CostSyntaxRewriterTests.Rewrite_NonDefaultWeights_DoesNotRemoveCostDirectives.graphql +++ b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/CostSyntaxRewriterTests.Rewrite_NonDefaultWeights_DoesNotRemoveCostDirectives.graphql @@ -2,14 +2,6 @@ schema { query: Query } -type CompositeType @cost(weight: "0") { - listField: [ElementType] @cost(weight: "0") -} - -type ElementType { - scalarField: Scalar @cost(weight: "1") -} - type Query { compositeField( inputArg: Input @cost(weight: "0") @@ -18,6 +10,14 @@ type Query { ): CompositeType @cost(weight: "0") } +type CompositeType @cost(weight: "0") { + listField: [ElementType] @cost(weight: "0") +} + +type ElementType { + scalarField: Scalar @cost(weight: "1") +} + input Input { inputField: Input @cost(weight: "0") listField: [Scalar] @cost(weight: "0") @@ -28,10 +28,10 @@ enum Enum @cost(weight: "1") { ENUM_VALUE } +scalar Scalar @cost(weight: "1") + "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." directive @cost( "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." weight: String! ) on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | ENUM | INPUT_FIELD_DEFINITION - -scalar Scalar @cost(weight: "1") diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Do_Not_Apply_Defaults.graphql b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Do_Not_Apply_Defaults.graphql index 3211186bf05..6f596dfdd51 100644 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Do_Not_Apply_Defaults.graphql +++ b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Do_Not_Apply_Defaults.graphql @@ -2,6 +2,45 @@ schema { query: Query } +type Query { + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: BookFilterInput + order: [BookSortInput!] + ): BooksConnection + booksWithTotalCount( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: BookFilterInput + order: [BookSortInput!] + ): BooksTotalConnection + booksOffset( + skip: Int + take: Int + where: BookFilterInput + order: [BookSortInput!] + ): BooksOffsetCollectionSegment + booksOffsetWithTotalCount( + skip: Int + take: Int + where: BookFilterInput + order: [BookSortInput!] + ): BooksTotalCollectionSegment +} + type Author { name: String! } @@ -113,45 +152,6 @@ type PageInfo { endCursor: String } -type Query { - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: BookFilterInput - order: [BookSortInput!] - ): BooksConnection - booksWithTotalCount( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: BookFilterInput - order: [BookSortInput!] - ): BooksTotalConnection - booksOffset( - skip: Int - take: Int - where: BookFilterInput - order: [BookSortInput!] - ): BooksOffsetCollectionSegment - booksOffsetWithTotalCount( - skip: Int - take: Int - where: BookFilterInput - order: [BookSortInput!] - ): BooksTotalCollectionSegment -} - input BookFilterInput { and: [BookFilterInput!] or: [BookFilterInput!] diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Do_Not_Use_Default_Page_Size_When_Default_Is_Specified.md b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Do_Not_Use_Default_Page_Size_When_Default_Is_Specified.md index 574fbedd928..83667823307 100644 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Do_Not_Use_Default_Page_Size_When_Default_Is_Specified.md +++ b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Do_Not_Use_Default_Page_Size_When_Default_Is_Specified.md @@ -37,6 +37,53 @@ schema { query: Query } +type Query { + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: BookFilterInput @cost(weight: "10") + order: [BookSortInput!] @cost(weight: "10") + ): BooksConnection + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) + @cost(weight: "10") + booksWithTotalCount( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: BookFilterInput @cost(weight: "10") + order: [BookSortInput!] @cost(weight: "10") + ): BooksTotalConnection + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) + @cost(weight: "10") + booksOffset( + skip: Int + take: Int + where: BookFilterInput @cost(weight: "10") + order: [BookSortInput!] @cost(weight: "10") + ): BooksOffsetCollectionSegment + @listSize(assumedSize: 50, slicingArguments: ["take"], sizedFields: ["items"], requireOneSlicingArgument: false) + @cost(weight: "10") + booksOffsetWithTotalCount( + skip: Int + take: Int + where: BookFilterInput @cost(weight: "10") + order: [BookSortInput!] @cost(weight: "10") + ): BooksTotalCollectionSegment + @listSize(assumedSize: 50, slicingArguments: ["take"], sizedFields: ["items"], requireOneSlicingArgument: false) + @cost(weight: "10") +} + type Author { name: String! } @@ -149,53 +196,6 @@ type PageInfo { endCursor: String } -type Query { - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: BookFilterInput @cost(weight: "10") - order: [BookSortInput!] @cost(weight: "10") - ): BooksConnection - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) - @cost(weight: "10") - booksWithTotalCount( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: BookFilterInput @cost(weight: "10") - order: [BookSortInput!] @cost(weight: "10") - ): BooksTotalConnection - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) - @cost(weight: "10") - booksOffset( - skip: Int - take: Int - where: BookFilterInput @cost(weight: "10") - order: [BookSortInput!] @cost(weight: "10") - ): BooksOffsetCollectionSegment - @listSize(assumedSize: 50, slicingArguments: ["take"], sizedFields: ["items"], requireOneSlicingArgument: false) - @cost(weight: "10") - booksOffsetWithTotalCount( - skip: Int - take: Int - where: BookFilterInput @cost(weight: "10") - order: [BookSortInput!] @cost(weight: "10") - ): BooksTotalCollectionSegment - @listSize(assumedSize: 50, slicingArguments: ["take"], sizedFields: ["items"], requireOneSlicingArgument: false) - @cost(weight: "10") -} - input BookFilterInput { and: [BookFilterInput!] or: [BookFilterInput!] diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Ensure_Paging_Defaults_Are_Applied.graphql b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Ensure_Paging_Defaults_Are_Applied.graphql index 464eb73548e..ec44c17eae3 100644 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Ensure_Paging_Defaults_Are_Applied.graphql +++ b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Ensure_Paging_Defaults_Are_Applied.graphql @@ -2,6 +2,53 @@ schema { query: Query } +type Query { + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: BookFilterInput @cost(weight: "10") + order: [BookSortInput!] @cost(weight: "10") + ): BooksConnection + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"]) + @cost(weight: "10") + booksWithTotalCount( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: BookFilterInput @cost(weight: "10") + order: [BookSortInput!] @cost(weight: "10") + ): BooksTotalConnection + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"]) + @cost(weight: "10") + booksOffset( + skip: Int + take: Int + where: BookFilterInput @cost(weight: "10") + order: [BookSortInput!] @cost(weight: "10") + ): BooksOffsetCollectionSegment + @listSize(assumedSize: 50, slicingArguments: ["take"], slicingArgumentDefaultValue: 10, sizedFields: ["items"]) + @cost(weight: "10") + booksOffsetWithTotalCount( + skip: Int + take: Int + where: BookFilterInput @cost(weight: "10") + order: [BookSortInput!] @cost(weight: "10") + ): BooksTotalCollectionSegment + @listSize(assumedSize: 50, slicingArguments: ["take"], slicingArgumentDefaultValue: 10, sizedFields: ["items"]) + @cost(weight: "10") +} + type Author { name: String! } @@ -114,53 +161,6 @@ type PageInfo { endCursor: String } -type Query { - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: BookFilterInput @cost(weight: "10") - order: [BookSortInput!] @cost(weight: "10") - ): BooksConnection - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"]) - @cost(weight: "10") - booksWithTotalCount( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: BookFilterInput @cost(weight: "10") - order: [BookSortInput!] @cost(weight: "10") - ): BooksTotalConnection - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"]) - @cost(weight: "10") - booksOffset( - skip: Int - take: Int - where: BookFilterInput @cost(weight: "10") - order: [BookSortInput!] @cost(weight: "10") - ): BooksOffsetCollectionSegment - @listSize(assumedSize: 50, slicingArguments: ["take"], slicingArgumentDefaultValue: 10, sizedFields: ["items"]) - @cost(weight: "10") - booksOffsetWithTotalCount( - skip: Int - take: Int - where: BookFilterInput @cost(weight: "10") - order: [BookSortInput!] @cost(weight: "10") - ): BooksTotalCollectionSegment - @listSize(assumedSize: 50, slicingArguments: ["take"], slicingArgumentDefaultValue: 10, sizedFields: ["items"]) - @cost(weight: "10") -} - input BookFilterInput { and: [BookFilterInput!] or: [BookFilterInput!] diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Use_Default_Page_Size_When_Default_Is_Specified.md b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Use_Default_Page_Size_When_Default_Is_Specified.md index a797e64fcf4..57c39733086 100644 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Use_Default_Page_Size_When_Default_Is_Specified.md +++ b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/PagingTests.Use_Default_Page_Size_When_Default_Is_Specified.md @@ -37,6 +37,53 @@ schema { query: Query } +type Query { + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: BookFilterInput @cost(weight: "10") + order: [BookSortInput!] @cost(weight: "10") + ): BooksConnection + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 2, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) + @cost(weight: "10") + booksWithTotalCount( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: BookFilterInput @cost(weight: "10") + order: [BookSortInput!] @cost(weight: "10") + ): BooksTotalConnection + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 2, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) + @cost(weight: "10") + booksOffset( + skip: Int + take: Int + where: BookFilterInput @cost(weight: "10") + order: [BookSortInput!] @cost(weight: "10") + ): BooksOffsetCollectionSegment + @listSize(assumedSize: 50, slicingArguments: ["take"], slicingArgumentDefaultValue: 2, sizedFields: ["items"], requireOneSlicingArgument: false) + @cost(weight: "10") + booksOffsetWithTotalCount( + skip: Int + take: Int + where: BookFilterInput @cost(weight: "10") + order: [BookSortInput!] @cost(weight: "10") + ): BooksTotalCollectionSegment + @listSize(assumedSize: 50, slicingArguments: ["take"], slicingArgumentDefaultValue: 2, sizedFields: ["items"], requireOneSlicingArgument: false) + @cost(weight: "10") +} + type Author { name: String! } @@ -149,53 +196,6 @@ type PageInfo { endCursor: String } -type Query { - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: BookFilterInput @cost(weight: "10") - order: [BookSortInput!] @cost(weight: "10") - ): BooksConnection - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 2, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) - @cost(weight: "10") - booksWithTotalCount( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: BookFilterInput @cost(weight: "10") - order: [BookSortInput!] @cost(weight: "10") - ): BooksTotalConnection - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 2, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) - @cost(weight: "10") - booksOffset( - skip: Int - take: Int - where: BookFilterInput @cost(weight: "10") - order: [BookSortInput!] @cost(weight: "10") - ): BooksOffsetCollectionSegment - @listSize(assumedSize: 50, slicingArguments: ["take"], slicingArgumentDefaultValue: 2, sizedFields: ["items"], requireOneSlicingArgument: false) - @cost(weight: "10") - booksOffsetWithTotalCount( - skip: Int - take: Int - where: BookFilterInput @cost(weight: "10") - order: [BookSortInput!] @cost(weight: "10") - ): BooksTotalCollectionSegment - @listSize(assumedSize: 50, slicingArguments: ["take"], slicingArgumentDefaultValue: 2, sizedFields: ["items"], requireOneSlicingArgument: false) - @cost(weight: "10") -} - input BookFilterInput { and: [BookFilterInput!] or: [BookFilterInput!] diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SchemaIntegrationTests.Rewrite_DefaultWeights_RemovesCostDirectives.graphql b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SchemaIntegrationTests.Rewrite_DefaultWeights_RemovesCostDirectives.graphql index 88fa710dc6f..f94509f1788 100644 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SchemaIntegrationTests.Rewrite_DefaultWeights_RemovesCostDirectives.graphql +++ b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SchemaIntegrationTests.Rewrite_DefaultWeights_RemovesCostDirectives.graphql @@ -2,6 +2,10 @@ schema { query: Query } +type Query { + compositeField(inputArg: Input, listArg: [Scalar], scalarArg: Scalar): CompositeType +} + type CompositeType { listField: [ElementType] } @@ -10,10 +14,6 @@ type ElementType { scalarField: Scalar } -type Query { - compositeField(inputArg: Input, listArg: [Scalar], scalarArg: Scalar): CompositeType -} - input Input { inputField: Input listField: [Scalar] @@ -24,10 +24,10 @@ enum Enum { ENUM_VALUE } +scalar Scalar + "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." directive @cost( "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." weight: String! ) on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | ENUM | INPUT_FIELD_DEFINITION - -scalar Scalar diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SchemaIntegrationTests.Rewrite_NonDefaultWeights_DoesNotRemoveCostDirectives.graphql b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SchemaIntegrationTests.Rewrite_NonDefaultWeights_DoesNotRemoveCostDirectives.graphql index 4ba6725bb8b..75fce81b1aa 100644 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SchemaIntegrationTests.Rewrite_NonDefaultWeights_DoesNotRemoveCostDirectives.graphql +++ b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SchemaIntegrationTests.Rewrite_NonDefaultWeights_DoesNotRemoveCostDirectives.graphql @@ -2,14 +2,6 @@ schema { query: Query } -type CompositeType @cost(weight: "0") { - listField: [ElementType] @cost(weight: "0") -} - -type ElementType { - scalarField: Scalar @cost(weight: "1") -} - type Query { compositeField( inputArg: Input @cost(weight: "0") @@ -18,6 +10,14 @@ type Query { ): CompositeType @cost(weight: "0") } +type CompositeType @cost(weight: "0") { + listField: [ElementType] @cost(weight: "0") +} + +type ElementType { + scalarField: Scalar @cost(weight: "1") +} + input Input { inputField: Input @cost(weight: "0") listField: [Scalar] @cost(weight: "0") @@ -28,10 +28,10 @@ enum Enum @cost(weight: "1") { ENUM_VALUE } +scalar Scalar @cost(weight: "1") + "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." directive @cost( "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." weight: String! ) on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | ENUM | INPUT_FIELD_DEFINITION - -scalar Scalar @cost(weight: "1") diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SlicingArgumentsTests.SlicingArgumentDefaultValue_Inferred_From_DefaultPageSize.graphql b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SlicingArgumentsTests.SlicingArgumentDefaultValue_Inferred_From_DefaultPageSize.graphql index f14145281d1..a97e5cd8ff0 100644 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SlicingArgumentsTests.SlicingArgumentDefaultValue_Inferred_From_DefaultPageSize.graphql +++ b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SlicingArgumentsTests.SlicingArgumentDefaultValue_Inferred_From_DefaultPageSize.graphql @@ -2,6 +2,20 @@ schema { query: Query2 } +type Query2 { + foos( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): FoosConnection + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 42, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) +} + "A connection to a list of items." type FoosConnection { "Information to aid in pagination." @@ -32,20 +46,6 @@ type PageInfo { endCursor: String } -type Query2 { - foos( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): FoosConnection - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 42, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) -} - "The purpose of the `@listSize` directive is to either inform the static analysis about the size of returned lists (if that information is statically available), or to point the analysis to where to find that information." directive @listSize( "The `assumedSize` argument can be used to statically define the maximum length of a list returned by a field." diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SlicingArgumentsTests.SlicingArgumentDefaultValue_ListSizeAttribute_HasPrecedenceOver_DefaultPageSize.graphql b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SlicingArgumentsTests.SlicingArgumentDefaultValue_ListSizeAttribute_HasPrecedenceOver_DefaultPageSize.graphql index 7ff77f4e787..a3c14a61c46 100644 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SlicingArgumentsTests.SlicingArgumentDefaultValue_ListSizeAttribute_HasPrecedenceOver_DefaultPageSize.graphql +++ b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/SlicingArgumentsTests.SlicingArgumentDefaultValue_ListSizeAttribute_HasPrecedenceOver_DefaultPageSize.graphql @@ -2,6 +2,20 @@ schema { query: Query3 } +type Query3 { + foos( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): FoosConnection + @listSize(assumedSize: 10, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 999, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) +} + "A connection to a list of items." type FoosConnection { "Information to aid in pagination." @@ -32,20 +46,6 @@ type PageInfo { endCursor: String } -type Query3 { - foos( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): FoosConnection - @listSize(assumedSize: 10, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 999, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) -} - "The purpose of the `@listSize` directive is to either inform the static analysis about the size of returned lists (if that information is statically available), or to point the analysis to where to find that information." directive @listSize( "The `assumedSize` argument can be used to statically define the maximum length of a list returned by a field." diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/UseDbContextTests.Infer_Schema_From_IQueryable_Fields.snap b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/UseDbContextTests.Infer_Schema_From_IQueryable_Fields.snap index 7a12c85e1cc..84fce14bf06 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/UseDbContextTests.Infer_Schema_From_IQueryable_Fields.snap +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/UseDbContextTests.Infer_Schema_From_IQueryable_Fields.snap @@ -2,6 +2,62 @@ schema { query: Query } +type Query { + authors: [Author!]! + author: Author! + authorSync: Author + authorOffsetPaging( + skip: Int + take: Int + where: AuthorFilterInput + order: [AuthorSortInput!] + ): AuthorOffsetPagingCollectionSegment + authorOffsetPagingExecutable( + skip: Int + take: Int + where: AuthorFilterInput + order: [AuthorSortInput!] + ): AuthorOffsetPagingExecutableCollectionSegment + authorCursorPagingExecutable( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: AuthorFilterInput + order: [AuthorSortInput!] + ): AuthorCursorPagingExecutableConnection + authorCursorPaging( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorCursorPagingConnection + queryableExtensionsCursor( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): QueryableExtensionsCursorConnection + queryableExtensionsOffset( + skip: Int + take: Int + where: AuthorFilterInput + order: [AuthorSortInput!] + ): QueryableExtensionsOffsetCollectionSegment +} + type Author { id: Int! name: String! @@ -93,62 +149,6 @@ type PageInfo { endCursor: String } -type Query { - authors: [Author!]! - author: Author! - authorSync: Author - authorOffsetPaging( - skip: Int - take: Int - where: AuthorFilterInput - order: [AuthorSortInput!] - ): AuthorOffsetPagingCollectionSegment - authorOffsetPagingExecutable( - skip: Int - take: Int - where: AuthorFilterInput - order: [AuthorSortInput!] - ): AuthorOffsetPagingExecutableCollectionSegment - authorCursorPagingExecutable( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: AuthorFilterInput - order: [AuthorSortInput!] - ): AuthorCursorPagingExecutableConnection - authorCursorPaging( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorCursorPagingConnection - queryableExtensionsCursor( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): QueryableExtensionsCursorConnection - queryableExtensionsOffset( - skip: Int - take: Int - where: AuthorFilterInput - order: [AuthorSortInput!] - ): QueryableExtensionsOffsetCollectionSegment -} - "A connection to a list of items." type QueryableExtensionsCursorConnection { "Information to aid in pagination." diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/UseDbContextTests.Infer_Schema_From_IQueryable_Task_Fields.snap b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/UseDbContextTests.Infer_Schema_From_IQueryable_Task_Fields.snap index 17aa65e777b..f3e2513d05e 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/UseDbContextTests.Infer_Schema_From_IQueryable_Task_Fields.snap +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/UseDbContextTests.Infer_Schema_From_IQueryable_Task_Fields.snap @@ -2,6 +2,44 @@ schema { query: QueryTask } +type QueryTask { + authors: [Author!]! + authorOffsetPaging( + skip: Int + take: Int + where: AuthorFilterInput + order: [AuthorSortInput!] + ): AuthorOffsetPagingCollectionSegment + authorOffsetPagingExecutable( + skip: Int + take: Int + where: AuthorFilterInput + order: [AuthorSortInput!] + ): AuthorOffsetPagingExecutableCollectionSegment + authorCursorPagingExecutable( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: AuthorFilterInput + order: [AuthorSortInput!] + ): AuthorCursorPagingExecutableConnection + authorCursorPaging( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorCursorPagingConnection +} + type Author { id: Int! name: String! @@ -93,44 +131,6 @@ type PageInfo { endCursor: String } -type QueryTask { - authors: [Author!]! - authorOffsetPaging( - skip: Int - take: Int - where: AuthorFilterInput - order: [AuthorSortInput!] - ): AuthorOffsetPagingCollectionSegment - authorOffsetPagingExecutable( - skip: Int - take: Int - where: AuthorFilterInput - order: [AuthorSortInput!] - ): AuthorOffsetPagingExecutableCollectionSegment - authorCursorPagingExecutable( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: AuthorFilterInput - order: [AuthorSortInput!] - ): AuthorCursorPagingExecutableConnection - authorCursorPaging( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorCursorPagingConnection -} - input AuthorFilterInput { and: [AuthorFilterInput!] or: [AuthorFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/UseDbContextTests.Infer_Schema_From_IQueryable_ValueTask_Fields.snap b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/UseDbContextTests.Infer_Schema_From_IQueryable_ValueTask_Fields.snap index b66e873d5be..229852ecf33 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/UseDbContextTests.Infer_Schema_From_IQueryable_ValueTask_Fields.snap +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/UseDbContextTests.Infer_Schema_From_IQueryable_ValueTask_Fields.snap @@ -2,6 +2,44 @@ schema { query: QueryValueTask } +type QueryValueTask { + authors: [Author!]! + authorOffsetPaging( + skip: Int + take: Int + where: AuthorFilterInput + order: [AuthorSortInput!] + ): AuthorOffsetPagingCollectionSegment + authorOffsetPagingExecutable( + skip: Int + take: Int + where: AuthorFilterInput + order: [AuthorSortInput!] + ): AuthorOffsetPagingExecutableCollectionSegment + authorCursorPagingExecutable( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: AuthorFilterInput + order: [AuthorSortInput!] + ): AuthorCursorPagingExecutableConnection + authorCursorPaging( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorCursorPagingConnection +} + type Author { id: Int! name: String! @@ -93,44 +131,6 @@ type PageInfo { endCursor: String } -type QueryValueTask { - authors: [Author!]! - authorOffsetPaging( - skip: Int - take: Int - where: AuthorFilterInput - order: [AuthorSortInput!] - ): AuthorOffsetPagingCollectionSegment - authorOffsetPagingExecutable( - skip: Int - take: Int - where: AuthorFilterInput - order: [AuthorSortInput!] - ): AuthorOffsetPagingExecutableCollectionSegment - authorCursorPagingExecutable( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: AuthorFilterInput - order: [AuthorSortInput!] - ): AuthorCursorPagingExecutableConnection - authorCursorPaging( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorCursorPagingConnection -} - input AuthorFilterInput { and: [AuthorFilterInput!] or: [AuthorFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionScopeTests.FilterConvention_Should_Work_When_ConfiguredWithAttributes.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionScopeTests.FilterConvention_Should_Work_When_ConfiguredWithAttributes.graphql index 07e33186a55..f556bbdfed9 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionScopeTests.FilterConvention_Should_Work_When_ConfiguredWithAttributes.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionScopeTests.FilterConvention_Should_Work_When_ConfiguredWithAttributes.graphql @@ -2,15 +2,15 @@ schema { query: Query1 } -type Foo { - bar: String! -} - type Query1 { foos(where: FooFilterInput): [Foo!]! foosBar(where: Bar_FooFilterInput): [Foo!]! } +type Foo { + bar: String! +} + input Bar_FooFilterInput { and: [Bar_FooFilterInput!] or: [Bar_FooFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionScopeTests.FilterConvention_Should_Work_When_ConfiguredWithType.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionScopeTests.FilterConvention_Should_Work_When_ConfiguredWithType.graphql index 99777ba71ad..c1c30fcf302 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionScopeTests.FilterConvention_Should_Work_When_ConfiguredWithType.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionScopeTests.FilterConvention_Should_Work_When_ConfiguredWithType.graphql @@ -2,15 +2,15 @@ schema { query: QueryType } -type Foo { - bar: String! -} - type QueryType { foos(where: FooFilterInput): [Foo] foosBar(where: Bar_FooFilterInput): [Foo] } +type Foo { + bar: String! +} + input Bar_FooFilterInput { and: [Bar_FooFilterInput!] or: [Bar_FooFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionTests.FilterConvention_Should_NotAddAnd.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionTests.FilterConvention_Should_NotAddAnd.graphql index 8ba2cc89951..54b1b0ab3c6 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionTests.FilterConvention_Should_NotAddAnd.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionTests.FilterConvention_Should_NotAddAnd.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foos(where: FooFilterInput): [Foo] } +type Foo { + bar: String! +} + input FooFilterInput { or: [FooFilterInput!] bar: StringOperationFilterInput diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionTests.FilterConvention_Should_NotAddOr.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionTests.FilterConvention_Should_NotAddOr.graphql index 1b6fea5c620..92725c6b2ea 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionTests.FilterConvention_Should_NotAddOr.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionTests.FilterConvention_Should_NotAddOr.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foos(where: FooFilterInput): [Foo] } +type Foo { + bar: String! +} + input FooFilterInput { and: [FooFilterInput!] bar: StringOperationFilterInput diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionTests.FilterConvention_Should_UseBoundFilterType.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionTests.FilterConvention_Should_UseBoundFilterType.graphql index 78916d2389c..7227b3eb1fe 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionTests.FilterConvention_Should_UseBoundFilterType.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Convention/__snapshots__/FilterConventionTests.FilterConvention_Should_UseBoundFilterType.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foos(where: FooFilterInput): [Foo] } +type Foo { + bar: String! +} + input FooFilterInput { and: [FooFilterInput!] or: [FooFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorComparableTests.Overwrite_Comparable_Filter_Type_With_Attribute.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorComparableTests.Overwrite_Comparable_Filter_Type_With_Attribute.graphql index 4265536ec2d..6e61da354d1 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorComparableTests.Overwrite_Comparable_Filter_Type_With_Attribute.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorComparableTests.Overwrite_Comparable_Filter_Type_With_Attribute.graphql @@ -27,12 +27,6 @@ input ShortOperationFilterInput { nlte: Short } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `Short` scalar type represents a signed 16-bit integer." scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorEnumTests.Overwrite_Enum_Filter_Type_With_Attribute.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorEnumTests.Overwrite_Enum_Filter_Type_With_Attribute.graphql index 973eba95af4..bba0b7cf4c2 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorEnumTests.Overwrite_Enum_Filter_Type_With_Attribute.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Expression/__snapshots__/QueryableFilterVisitorEnumTests.Overwrite_Enum_Filter_Type_With_Attribute.graphql @@ -27,12 +27,6 @@ input ShortOperationFilterInput { nlte: Short } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `Short` scalar type represents a signed 16-bit integer." scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation.graphql index 6f2b7f99213..88666239dd0 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation.graphql @@ -329,12 +329,6 @@ enum FooBar { BAR } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `Decimal` scalar type represents a decimal floating-point number with high precision." scalar Decimal @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") @@ -355,9 +349,9 @@ scalar Long scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") -"The `URI` scalar type represents a Uniform Resource Identifier (URI) as defined by RFC 3986." -scalar URI @specifiedBy(url: "https://scalars.graphql.org/chillicream/uri.html") - "The `UnsignedByte` scalar type represents an unsigned 8-bit integer." scalar UnsignedByte @specifiedBy(url: "https://scalars.graphql.org/chillicream/unsigned-byte.html") + +"The `URI` scalar type represents a Uniform Resource Identifier (URI) as defined by RFC 3986." +scalar URI @specifiedBy(url: "https://scalars.graphql.org/chillicream/uri.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation_Normalized.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation_Normalized.graphql index 748ba25d313..87b64c53875 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation_Normalized.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ComparableOperationInputTests.Create_Implicit_Operation_Normalized.graphql @@ -179,12 +179,6 @@ enum FooBar { BAR } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `Decimal` scalar type represents a decimal floating-point number with high precision." scalar Decimal @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") @@ -205,9 +199,9 @@ scalar Long scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") -"The `URI` scalar type represents a Uniform Resource Identifier (URI) as defined by RFC 3986." -scalar URI @specifiedBy(url: "https://scalars.graphql.org/chillicream/uri.html") - "The `UnsignedByte` scalar type represents an unsigned 8-bit integer." scalar UnsignedByte @specifiedBy(url: "https://scalars.graphql.org/chillicream/unsigned-byte.html") + +"The `URI` scalar type represents a Uniform Resource Identifier (URI) as defined by RFC 3986." +scalar URI @specifiedBy(url: "https://scalars.graphql.org/chillicream/uri.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ListFilterInputTests.Create_Implicit_Operation.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ListFilterInputTests.Create_Implicit_Operation.graphql index f5ec8dc73c5..acfab07169b 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ListFilterInputTests.Create_Implicit_Operation.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ListFilterInputTests.Create_Implicit_Operation.graphql @@ -205,12 +205,6 @@ enum FooBar { BAR } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `Decimal` scalar type represents a decimal floating-point number with high precision." scalar Decimal @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/MethodOperationInputTests.Create_Explicit_Operation.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/MethodOperationInputTests.Create_Explicit_Operation.graphql index 135df0dce80..5c6d248957c 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/MethodOperationInputTests.Create_Explicit_Operation.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/MethodOperationInputTests.Create_Explicit_Operation.graphql @@ -2,6 +2,10 @@ schema { query: QueryExplicit } +type QueryExplicit { + foos(where: Test): [Foo!]! +} + type Bar { stringOperation: String! } @@ -11,10 +15,6 @@ type Foo { complexMethod: Bar! } -type QueryExplicit { - foos(where: Test): [Foo!]! -} - input BarFilterInput { and: [BarFilterInput!] or: [BarFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/MethodOperationInputTests.Create_Implicit_Operation.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/MethodOperationInputTests.Create_Implicit_Operation.graphql index c3e20412c0b..ad5eb932844 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/MethodOperationInputTests.Create_Implicit_Operation.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/MethodOperationInputTests.Create_Implicit_Operation.graphql @@ -2,6 +2,10 @@ schema { query: Query } +type Query { + foos(where: FooFilterInput): [Foo!]! +} + type Bar { stringOperation: String! } @@ -11,10 +15,6 @@ type Foo { complexMethod: Bar! } -type Query { - foos(where: FooFilterInput): [Foo!]! -} - input FooFilterInput { and: [FooFilterInput!] or: [FooFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Explicit_Operation.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Explicit_Operation.graphql index d497f01b833..0ed91f7c797 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Explicit_Operation.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Explicit_Operation.graphql @@ -40,12 +40,6 @@ input ShortOperationFilterInput { nlte: Short } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `Short` scalar type represents a signed 16-bit integer." scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Implicit_Operation.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Implicit_Operation.graphql index feb825c97e9..e4e364de29c 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Implicit_Operation.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/Types/__snapshots__/ObjectInputTests.Create_Implicit_Operation.graphql @@ -34,12 +34,6 @@ input ShortOperationFilterInput { nlte: Short } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `Short` scalar type represents a signed 16-bit integer." scalar Short @specifiedBy(url: "https://scalars.graphql.org/chillicream/short.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering.graphql index d7ab006490c..4eeaad8d610 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foos(where: FooFilterInput): [Foo!]! } +type Foo { + bar: String! +} + input FooFilterInput { and: [FooFilterInput!] or: [FooFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Descriptor.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Descriptor.graphql index 6518abcdb18..8039f2aa0b8 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Descriptor.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Descriptor.graphql @@ -2,12 +2,18 @@ schema { query: Query } +type Query { + foos(where: foo): [Foo!]! +} + type Foo { bar: String! } -type Query { - foos(where: foo): [Foo!]! +input foo { + and: [foo!] + or: [foo!] + foo: StringOperationFilterInput } input StringOperationFilterInput { @@ -24,9 +30,3 @@ input StringOperationFilterInput { endsWith: String nendsWith: String } - -input foo { - and: [foo!] - or: [foo!] - foo: StringOperationFilterInput -} diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Generic_RuntimeType.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Generic_RuntimeType.graphql index 94efde94fa3..1bbfaedfc11 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Generic_RuntimeType.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Generic_RuntimeType.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foos(where: BarFilterInput): [Foo!]! } +type Foo { + bar: String! +} + input BarFilterInput { and: [BarFilterInput!] or: [BarFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Generic_SchemaType.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Generic_SchemaType.graphql index 94efde94fa3..1bbfaedfc11 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Generic_SchemaType.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Generic_SchemaType.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foos(where: BarFilterInput): [Foo!]! } +type Foo { + bar: String! +} + input BarFilterInput { and: [BarFilterInput!] or: [BarFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Type_RuntimeType.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Type_RuntimeType.graphql index 94efde94fa3..1bbfaedfc11 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Type_RuntimeType.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Type_RuntimeType.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foos(where: BarFilterInput): [Foo!]! } +type Foo { + bar: String! +} + input BarFilterInput { and: [BarFilterInput!] or: [BarFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Type_SchemaType.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Type_SchemaType.graphql index 94efde94fa3..1bbfaedfc11 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Type_SchemaType.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/ExtensionTests.ObjectField_UseFiltering_Type_SchemaType.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foos(where: BarFilterInput): [Foo!]! } +type Foo { + bar: String! +} + input BarFilterInput { and: [BarFilterInput!] or: [BarFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterAttributes.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterAttributes.graphql index 132719f487c..6de0704d4dd 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterAttributes.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterAttributes.graphql @@ -2,15 +2,15 @@ schema { query: Query4 } +type Query4 { + bars(where: ItWorks): [Bar!]! +} + type Bar { baz: Long! shouldNotBeVisible: Int } -type Query4 { - bars(where: ItWorks): [Bar!]! -} - input ItWorks { and: [ItWorks!] or: [ItWorks!] @@ -32,12 +32,6 @@ input LongOperationFilterInput { nlte: Long } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `Long` scalar type represents a signed 64-bit integer." scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput.graphql index 34b4545e68e..f8fa4729867 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput.graphql @@ -2,16 +2,16 @@ schema { query: Query1 } +type Query1 { + foos(where: FooFilterInput): [Foo!]! +} + type Foo { bar: String! baz: Int! qux: Int } -type Query1 { - foos(where: FooFilterInput): [Foo!]! -} - input FooFilterInput { and: [FooFilterInput!] or: [FooFilterInput!] @@ -65,12 +65,6 @@ input StringOperationFilterInput { nendsWith: String } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `Long` scalar type represents a signed 64-bit integer." scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput_With_Fluent_API.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput_With_Fluent_API.graphql index 2a2db43e0ba..7543f38fa05 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput_With_Fluent_API.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput_With_Fluent_API.graphql @@ -2,16 +2,16 @@ schema { query: Query2 } +type Query2 { + foos(where: FooFilterInput): [Foo!]! +} + type Foo { bar: String! baz: Int! qux: Int } -type Query2 { - foos(where: FooFilterInput): [Foo!]! -} - input FooFilterInput { and: [FooFilterInput!] or: [FooFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput_With_Fluent_API_Ctor_Param.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput_With_Fluent_API_Ctor_Param.graphql index b76cff4b48d..f944561043b 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput_With_Fluent_API_Ctor_Param.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput_With_Fluent_API_Ctor_Param.graphql @@ -2,16 +2,16 @@ schema { query: Query3 } +type Query3 { + foos(where: FooFilterInput): [Foo!]! +} + type Foo { bar: String! baz: Int! qux: Int } -type Query3 { - foos(where: FooFilterInput): [Foo!]! -} - input FooFilterInput { and: [FooFilterInput!] or: [FooFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput_With_GenericAttribute.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput_With_GenericAttribute.graphql index 612ed676bac..7f9676fed23 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput_With_GenericAttribute.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterAttributeTests.Create_Schema_With_FilterInput_With_GenericAttribute.graphql @@ -2,16 +2,16 @@ schema { query: Query5 } +type Query5 { + foos(where: FooFilterInput): [Foo!]! +} + type Foo { bar: String! baz: Int! qux: Int } -type Query5 { - foos(where: FooFilterInput): [Foo!]! -} - input FooFilterInput { and: [FooFilterInput!] or: [FooFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding.graphql index eefa0e13518..4e74ee94d94 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding.graphql @@ -2,15 +2,15 @@ schema { query: Query } +type Query { + foo(where: BarFilterInput): Bar +} + type Bar { baz: String! qux: String! } -type Query { - foo(where: BarFilterInput): Bar -} - input BarFilterInput { and: [BarFilterInput!] or: [BarFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding_BindFields.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding_BindFields.graphql index eefa0e13518..4e74ee94d94 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding_BindFields.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding_BindFields.graphql @@ -2,15 +2,15 @@ schema { query: Query } +type Query { + foo(where: BarFilterInput): Bar +} + type Bar { baz: String! qux: String! } -type Query { - foo(where: BarFilterInput): Bar -} - input BarFilterInput { and: [BarFilterInput!] or: [BarFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding.graphql index 13ba55a8a71..214e012549e 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foo(where: FooFilterInput): Foo } +type Foo { + bar: String! +} + input FooFilterInput { and: [FooFilterInput!] or: [FooFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding_BindFields.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding_BindFields.graphql index 13ba55a8a71..214e012549e 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding_BindFields.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding_BindFields.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foo(where: FooFilterInput): Foo } +type Foo { + bar: String! +} + input FooFilterInput { and: [FooFilterInput!] or: [FooFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_Should_IgnoreFieldWithoutCallingConvention.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_Should_IgnoreFieldWithoutCallingConvention.graphql index 9a59d295c71..d1d8ad5dfb8 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_Should_IgnoreFieldWithoutCallingConvention.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_Should_IgnoreFieldWithoutCallingConvention.graphql @@ -2,15 +2,15 @@ schema { query: Query } +type Query { + foo(where: IgnoreTestFilterInput): [IgnoreTest] +} + type IgnoreTest { id: Int! name: String! } -type Query { - foo(where: IgnoreTestFilterInput): [IgnoreTest] -} - input IgnoreTestFilterInput { and: [IgnoreTestFilterInput!] or: [IgnoreTestFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_Should_InfereType_When_ItIsAInterface.graphql b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_Should_InfereType_When_ItIsAInterface.graphql index 24e8cb4478a..4a692f8979f 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_Should_InfereType_When_ItIsAInterface.graphql +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_Should_InfereType_When_ItIsAInterface.graphql @@ -2,6 +2,10 @@ schema { query: Query } +type Query { + root(where: ITestOfFooFilterInput): ITestOfFoo! +} + type Foo { bar: String! } @@ -10,10 +14,6 @@ type ITestOfFoo { prop: Foo! } -type Query { - root(where: ITestOfFooFilterInput): ITestOfFoo! -} - input FooFilterInput { and: [FooFilterInput!] or: [FooFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.CreateSchema.graphql b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.CreateSchema.graphql index dad85983c5f..2e42a73e782 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.CreateSchema.graphql +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.CreateSchema.graphql @@ -2,13 +2,74 @@ schema { query: Query } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! -} - -interface StatementTransaction { - id: Int! +type Query { + "Fetches an object given its ID." + node("ID of the object." id: ID!): Node @shareable @cost(weight: "10") + "Lookup nodes by a list of IDs." + nodes("The list of node IDs." ids: [ID!]!): [Node]! + @shareable + @cost(weight: "10") + hiddenNameProductTypes( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: ProductTypeFilterInput @cost(weight: "10") + order: [ProductTypeSortInput!] @cost(weight: "10") + ): ProductTypeConnection! + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) + @cost(weight: "10") + scopeState: String! + brands( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: BrandFilterInput @cost(weight: "10") + ): BrandConnection! + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) + @cost(weight: "10") + brandById(id: ID!): Brand @lookup @cost(weight: "10") + brandByIdWithDL(id: ID!): Brand @lookup @cost(weight: "10") + products( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: ProductFilterInput @cost(weight: "10") + order: [ProductSortInput!] @cost(weight: "10") + ): ProductConnection! + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) + @cost(weight: "10") + productById(id: ID!): Product @lookup @internal @cost(weight: "10") + productsNonRelative( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: ProductFilterInput @cost(weight: "10") + order: [ProductSortInput!] @cost(weight: "10") + ): ProductConnection! + @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) + @cost(weight: "10") + singleProperties: [SingleProperty!]! @cost(weight: "10") + statementTransaction: StatementTransaction! } type BillingStatementTransaction implements StatementTransaction { @@ -176,76 +237,6 @@ type ProductTypeEdge @shareable { cursor: String! } -type Query { - "Fetches an object given its ID." - node("ID of the object." id: ID!): Node @shareable @cost(weight: "10") - "Lookup nodes by a list of IDs." - nodes("The list of node IDs." ids: [ID!]!): [Node]! - @shareable - @cost(weight: "10") - hiddenNameProductTypes( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: ProductTypeFilterInput @cost(weight: "10") - order: [ProductTypeSortInput!] @cost(weight: "10") - ): ProductTypeConnection! - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) - @cost(weight: "10") - scopeState: String! - brands( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: BrandFilterInput @cost(weight: "10") - ): BrandConnection! - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) - @cost(weight: "10") - brandById(id: ID!): Brand @lookup @cost(weight: "10") - brandByIdWithDL(id: ID!): Brand @lookup @cost(weight: "10") - products( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: ProductFilterInput @cost(weight: "10") - order: [ProductSortInput!] @cost(weight: "10") - ): ProductConnection! - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) - @cost(weight: "10") - productById(id: ID!): Product @lookup @internal @cost(weight: "10") - productsNonRelative( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: ProductFilterInput @cost(weight: "10") - order: [ProductSortInput!] @cost(weight: "10") - ): ProductConnection! - @listSize(assumedSize: 50, slicingArguments: ["first", "last"], slicingArgumentDefaultValue: 10, sizedFields: ["edges", "nodes"], requireOneSlicingArgument: false) - @cost(weight: "10") - singleProperties: [SingleProperty!]! @cost(weight: "10") - statementTransaction: StatementTransaction! -} - type SingleProperty { id: String! } @@ -258,6 +249,15 @@ type Supplier { brands: [Brand!]! } +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! +} + +interface StatementTransaction { + id: Int! +} + input BooleanOperationFilterInput { eq: Boolean @cost(weight: "10") neq: Boolean @cost(weight: "10") @@ -404,6 +404,16 @@ enum SortEnumType { DESC } +"The `Decimal` scalar type represents a decimal floating-point number with high precision." +scalar Decimal + @serializeAs(type: FLOAT) + @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") + +"The `UnsignedByte` scalar type represents an unsigned 8-bit integer." +scalar UnsignedByte + @serializeAs(type: INT) + @specifiedBy(url: "https://scalars.graphql.org/chillicream/unsigned-byte.html") + "The purpose of the `cost` directive is to define a `weight` for GraphQL types, fields, and arguments. Static analysis can use these weights when calculating the overall cost of a query or response." directive @cost( "The `weight` argument defines what value to add to the overall cost for every appearance, or possible appearance, of a type, field, argument, etc." @@ -476,19 +486,3 @@ more than one source schema is intentional and coordinated. directive @shareable repeatable on OBJECT | FIELD_DEFINITION """ directive @shareable repeatable on OBJECT | FIELD_DEFINITION - -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - -"The `Decimal` scalar type represents a decimal floating-point number with high precision." -scalar Decimal - @serializeAs(type: FLOAT) - @specifiedBy(url: "https://scalars.graphql.org/chillicream/decimal.html") - -"The `UnsignedByte` scalar type represents an unsigned 8-bit integer." -scalar UnsignedByte - @serializeAs(type: INT) - @specifiedBy(url: "https://scalars.graphql.org/chillicream/unsigned-byte.html") diff --git a/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/IntegrationTests.Mutation_Convention_With_Relay_Projection_Schema.graphql b/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/IntegrationTests.Mutation_Convention_With_Relay_Projection_Schema.graphql index db10b0c332b..ebca61f2708 100644 --- a/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/IntegrationTests.Mutation_Convention_With_Relay_Projection_Schema.graphql +++ b/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/IntegrationTests.Mutation_Convention_With_Relay_Projection_Schema.graphql @@ -3,13 +3,21 @@ schema { mutation: Mutation } -interface Error { - message: String! +type QueryWithNodeResolvers { + "Fetches an object given its ID." + node("ID of the object." id: ID!): Node + "Lookup nodes by a list of IDs." + nodes("The list of node IDs." ids: [ID!]!): [Node]! + all: [Foo!]! + byId(id: ID!): Foo + bazById(id: ID!): Baz + barById(id: ID!): Bar! } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! +type Mutation { + modify: ModifyPayload! + modifySingleOrDefault: ModifySingleOrDefaultPayload! + createRecord(input: CreateRecordInput!): CreateRecordPayload! } type AnError implements Error { @@ -47,21 +55,13 @@ type ModifySingleOrDefaultPayload { query: QueryWithNodeResolvers! } -type Mutation { - modify: ModifyPayload! - modifySingleOrDefault: ModifySingleOrDefaultPayload! - createRecord(input: CreateRecordInput!): CreateRecordPayload! +interface Error { + message: String! } -type QueryWithNodeResolvers { - "Fetches an object given its ID." - node("ID of the object." id: ID!): Node - "Lookup nodes by a list of IDs." - nodes("The list of node IDs." ids: [ID!]!): [Node]! - all: [Foo!]! - byId(id: ID!): Foo - bazById(id: ID!): Baz - barById(id: ID!): Bar! +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! } union CreateRecordError = AnError diff --git a/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/IntegrationTests.Node_Resolver_With_SingleOrDefault_Schema.graphql b/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/IntegrationTests.Node_Resolver_With_SingleOrDefault_Schema.graphql index 0f00ccc4999..0d116ad5a79 100644 --- a/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/IntegrationTests.Node_Resolver_With_SingleOrDefault_Schema.graphql +++ b/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/IntegrationTests.Node_Resolver_With_SingleOrDefault_Schema.graphql @@ -2,9 +2,15 @@ schema { query: QueryWithNodeResolvers } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! +type QueryWithNodeResolvers { + "Fetches an object given its ID." + node("ID of the object." id: ID!): Node + "Lookup nodes by a list of IDs." + nodes("The list of node IDs." ids: [ID!]!): [Node]! + all: [Foo!]! + byId(id: ID!): Foo + bazById(id: ID!): Baz + barById(id: ID!): Bar! } type Bar implements Node { @@ -22,13 +28,7 @@ type Foo implements Node { fieldOfFoo: String! } -type QueryWithNodeResolvers { - "Fetches an object given its ID." - node("ID of the object." id: ID!): Node - "Lookup nodes by a list of IDs." - nodes("The list of node IDs." ids: [ID!]!): [Node]! - all: [Foo!]! - byId(id: ID!): Foo - bazById(id: ID!): Baz - barById(id: ID!): Bar! +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! } diff --git a/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/ProjectionAttributeTests.SingleOrDefault_Attribute.snap b/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/ProjectionAttributeTests.SingleOrDefault_Attribute.snap index 26cddf20a0a..9928bfa934a 100644 --- a/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/ProjectionAttributeTests.SingleOrDefault_Attribute.snap +++ b/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/ProjectionAttributeTests.SingleOrDefault_Attribute.snap @@ -2,11 +2,11 @@ schema { query: SingleOrDefaultQuery } -type Foo { - bar: String! -} - type SingleOrDefaultQuery { fooQueryable: Foo fooEnumerable: Foo } + +type Foo { + bar: String! +} diff --git a/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/ProjectionAttributeTests.SingleOrDefault_Attribute_CustomType.snap b/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/ProjectionAttributeTests.SingleOrDefault_Attribute_CustomType.snap index 2d1eb268c03..9a9be1be17f 100644 --- a/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/ProjectionAttributeTests.SingleOrDefault_Attribute_CustomType.snap +++ b/src/HotChocolate/Data/test/Data.Projections.Tests/__snapshots__/ProjectionAttributeTests.SingleOrDefault_Attribute_CustomType.snap @@ -2,11 +2,11 @@ schema { query: SingleOrDefaultQuery } -type Renamed { - renamed: String! -} - type SingleOrDefaultQuery { fooQueryable: Renamed fooEnumerable: Renamed } + +type Renamed { + renamed: String! +} diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/Convention/__snapshots__/SortConventionScopeTests.SortConvention_Should_Work_When_ConfiguredWithAttributes.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/Convention/__snapshots__/SortConventionScopeTests.SortConvention_Should_Work_When_ConfiguredWithAttributes.graphql index b9baf4c5be0..3218c5bf4af 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/Convention/__snapshots__/SortConventionScopeTests.SortConvention_Should_Work_When_ConfiguredWithAttributes.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/Convention/__snapshots__/SortConventionScopeTests.SortConvention_Should_Work_When_ConfiguredWithAttributes.graphql @@ -2,15 +2,15 @@ schema { query: Query1 } -type Foo { - bar: String! -} - type Query1 { foos(order: [FooSortInput!]): [Foo!]! foosBar(order: [Bar_FooSortInput!]): [Foo!]! } +type Foo { + bar: String! +} + input Bar_FooSortInput { bar: Bar_SortEnumType } diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/Convention/__snapshots__/SortConventionScopeTests.SortConvention_Should_Work_When_ConfiguredWithType.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/Convention/__snapshots__/SortConventionScopeTests.SortConvention_Should_Work_When_ConfiguredWithType.graphql index 5ced3e2e2aa..44742551e10 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/Convention/__snapshots__/SortConventionScopeTests.SortConvention_Should_Work_When_ConfiguredWithType.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/Convention/__snapshots__/SortConventionScopeTests.SortConvention_Should_Work_When_ConfiguredWithType.graphql @@ -2,15 +2,15 @@ schema { query: QueryType } -type Foo { - bar: String! -} - type QueryType { foos(order: [FooSortInput!]): [Foo] foosBar(order: [Bar_FooSortInput!]): [Foo] } +type Foo { + bar: String! +} + input Bar_FooSortInput { bar: Bar_SortEnumType } diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting.graphql index 0391c94d2b9..cd265d6aa3d 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foos(order: [FooSortInput!]): [Foo!]! } +type Foo { + bar: String! +} + input FooSortInput { bar: SortEnumType } diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Generic_RuntimeType.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Generic_RuntimeType.graphql index bf4f8d2f22b..eb2bdaa8ada 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Generic_RuntimeType.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Generic_RuntimeType.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foos(order: [BarSortInput!]): [Foo!]! } +type Foo { + bar: String! +} + input BarSortInput { foo: SortEnumType } diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Generic_SchemaType.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Generic_SchemaType.graphql index bf4f8d2f22b..eb2bdaa8ada 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Generic_SchemaType.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Generic_SchemaType.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foos(order: [BarSortInput!]): [Foo!]! } +type Foo { + bar: String! +} + input BarSortInput { foo: SortEnumType } diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Type_RuntimeType.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Type_RuntimeType.graphql index bf4f8d2f22b..eb2bdaa8ada 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Type_RuntimeType.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Type_RuntimeType.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foos(order: [BarSortInput!]): [Foo!]! } +type Foo { + bar: String! +} + input BarSortInput { foo: SortEnumType } diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Type_SchemaType.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Type_SchemaType.graphql index bf4f8d2f22b..eb2bdaa8ada 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Type_SchemaType.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/ExtensionTests.ObjectField_UseSorting_Type_SchemaType.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type Foo { - bar: String! -} - type Query { foos(order: [BarSortInput!]): [Foo!]! } +type Foo { + bar: String! +} + input BarSortInput { foo: SortEnumType } diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_GenericSortAttributes.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_GenericSortAttributes.graphql index 18a28f5d3ee..dc7482d2b70 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_GenericSortAttributes.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_GenericSortAttributes.graphql @@ -2,16 +2,16 @@ schema { query: Query5 } +type Query5 { + foos(order: [FooSortInput!]): [Foo!]! +} + type Foo { bar: String! baz: Int! qux: Int } -type Query5 { - foos(order: [FooSortInput!]): [Foo!]! -} - input FooSortInput { bar: SortEnumType } diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortAttributes.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortAttributes.graphql index a3a506e8218..4d8f11faa0d 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortAttributes.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortAttributes.graphql @@ -2,15 +2,15 @@ schema { query: Query4 } +type Query4 { + bars(order: [ItWorks!]): [Bar!]! +} + type Bar { baz: Long! shouldNotBeVisible: Int } -type Query4 { - bars(order: [ItWorks!]): [Bar!]! -} - input ItWorks { baz: SortEnumType } @@ -20,12 +20,6 @@ enum SortEnumType { DESC } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `Long` scalar type represents a signed 64-bit integer." scalar Long @specifiedBy(url: "https://scalars.graphql.org/chillicream/long.html") diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortType.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortType.graphql index 7b3511c3045..beae2615b24 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortType.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortType.graphql @@ -2,16 +2,16 @@ schema { query: Query1 } +type Query1 { + foos(order: [FooSortInput!]): [Foo!]! +} + type Foo { bar: String! baz: Int! qux: Int } -type Query1 { - foos(order: [FooSortInput!]): [Foo!]! -} - input FooSortInput { bar: SortEnumType baz: SortEnumType diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortType_With_Fluent_API.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortType_With_Fluent_API.graphql index 3b8d3cbe7e9..9aa5b6373d0 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortType_With_Fluent_API.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortType_With_Fluent_API.graphql @@ -2,16 +2,16 @@ schema { query: Query2 } +type Query2 { + foos(order: [FooSortInput!]): [Foo!]! +} + type Foo { bar: String! baz: Int! qux: Int } -type Query2 { - foos(order: [FooSortInput!]): [Foo!]! -} - input FooSortInput { bar: SortEnumType } diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortType_With_Fluent_API_Ctor_Param.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortType_With_Fluent_API_Ctor_Param.graphql index 24e0df52ac4..42aa5daa9b5 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortType_With_Fluent_API_Ctor_Param.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortAttributeTests.Create_Schema_With_SortType_With_Fluent_API_Ctor_Param.graphql @@ -2,16 +2,16 @@ schema { query: Query3 } +type Query3 { + foos(order: [FooSortInput!]): [Foo!]! +} + type Foo { bar: String! baz: Int! qux: Int } -type Query3 { - foos(order: [FooSortInput!]): [Foo!]! -} - input FooSortInput { bar: SortEnumType } diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortInputTypeTests.SortInputType_Should_IgnoreFieldWithoutCallingConvention.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortInputTypeTests.SortInputType_Should_IgnoreFieldWithoutCallingConvention.graphql index f306442467f..d3ce55eba14 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortInputTypeTests.SortInputType_Should_IgnoreFieldWithoutCallingConvention.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortInputTypeTests.SortInputType_Should_IgnoreFieldWithoutCallingConvention.graphql @@ -2,15 +2,15 @@ schema { query: Query } +type Query { + foo(order: [IgnoreTestSortInput!]): [IgnoreTest] +} + type IgnoreTest { id: Int! name: String! } -type Query { - foo(order: [IgnoreTestSortInput!]): [IgnoreTest] -} - input IgnoreTestSortInput { id: SortEnumType } diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortInputTypeTests.SortInputType_Should_InfereType_When_ItIsAInterface.graphql b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortInputTypeTests.SortInputType_Should_InfereType_When_ItIsAInterface.graphql index 24e8cb4478a..4a692f8979f 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortInputTypeTests.SortInputType_Should_InfereType_When_ItIsAInterface.graphql +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortInputTypeTests.SortInputType_Should_InfereType_When_ItIsAInterface.graphql @@ -2,6 +2,10 @@ schema { query: Query } +type Query { + root(where: ITestOfFooFilterInput): ITestOfFoo! +} + type Foo { bar: String! } @@ -10,10 +14,6 @@ type ITestOfFoo { prop: Foo! } -type Query { - root(where: ITestOfFooFilterInput): ITestOfFoo! -} - input FooFilterInput { and: [FooFilterInput!] or: [FooFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortInputTypeTests.SortInputType_Should_InfereType_When_ItIsAInterface.snap b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortInputTypeTests.SortInputType_Should_InfereType_When_ItIsAInterface.snap index 24e8cb4478a..4a692f8979f 100644 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortInputTypeTests.SortInputType_Should_InfereType_When_ItIsAInterface.snap +++ b/src/HotChocolate/Data/test/Data.Sorting.Tests/__snapshots__/SortInputTypeTests.SortInputType_Should_InfereType_When_ItIsAInterface.snap @@ -2,6 +2,10 @@ schema { query: Query } +type Query { + root(where: ITestOfFooFilterInput): ITestOfFoo! +} + type Foo { bar: String! } @@ -10,10 +14,6 @@ type ITestOfFoo { prop: Foo! } -type Query { - root(where: ITestOfFooFilterInput): ITestOfFoo! -} - input FooFilterInput { and: [FooFilterInput!] or: [FooFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.CreateSchema_CodeFirst_AsyncQueryable.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.CreateSchema_CodeFirst_AsyncQueryable.snap index e3f521ae9fb..296649e07ed 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.CreateSchema_CodeFirst_AsyncQueryable.snap +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.CreateSchema_CodeFirst_AsyncQueryable.snap @@ -17,14 +17,14 @@ schema { query: FooType } -type Bar { - qux: String! -} - type FooType { foos(where: BarFilterInput): [Bar] } +type Bar { + qux: String! +} + input BarFilterInput { and: [BarFilterInput!] or: [BarFilterInput!] diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.CreateSchema_OnDifferentScope.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.CreateSchema_OnDifferentScope.snap index 8a418a84d75..9696bb468bd 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.CreateSchema_OnDifferentScope.snap +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.CreateSchema_OnDifferentScope.snap @@ -19,6 +19,21 @@ schema { query: DifferentScope } +type DifferentScope { + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: Foo_BookFilterInput + order: [Foo_BookSortInput!] + ): BooksConnection +} + type Author { id: Int! name: String @@ -52,21 +67,6 @@ type BooksEdge { node: Book! } -type DifferentScope { - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: Foo_BookFilterInput - order: [Foo_BookSortInput!] - ): BooksConnection -} - "Information about pagination in a connection." type PageInfo { "Indicates whether more edges exist following the set defined by the clients arguments." diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.ExecuteAsync_Should_ProjectAndPage_When_AliasIsSameAsAlwaysProjectedField.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.ExecuteAsync_Should_ProjectAndPage_When_AliasIsSameAsAlwaysProjectedField.snap index cd63704a0e9..f669995c501 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.ExecuteAsync_Should_ProjectAndPage_When_AliasIsSameAsAlwaysProjectedField.snap +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.ExecuteAsync_Should_ProjectAndPage_When_AliasIsSameAsAlwaysProjectedField.snap @@ -19,9 +19,23 @@ schema { query: Query } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! +type Query { + "Fetches an object given its ID." + node("ID of the object." id: ID!): Node + "Lookup nodes by a list of IDs." + nodes("The list of node IDs." ids: [ID!]!): [Node]! + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: BookFilterInput + order: [BookSortInput!] + ): BooksConnection } type Author { @@ -78,23 +92,9 @@ type Publisher { authors: [Author!]! } -type Query { - "Fetches an object given its ID." - node("ID of the object." id: ID!): Node - "Lookup nodes by a list of IDs." - nodes("The list of node IDs." ids: [ID!]!): [Node]! - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: BookFilterInput - order: [BookSortInput!] - ): BooksConnection +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! } input AuthorFilterInput { diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.ExecuteAsync_Should_ProjectAndPage_When_NodesFragmentContainsProjectedField_With_Extensions.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.ExecuteAsync_Should_ProjectAndPage_When_NodesFragmentContainsProjectedField_With_Extensions.snap index 0b9a57ea775..62a947d9768 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.ExecuteAsync_Should_ProjectAndPage_When_NodesFragmentContainsProjectedField_With_Extensions.snap +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.ExecuteAsync_Should_ProjectAndPage_When_NodesFragmentContainsProjectedField_With_Extensions.snap @@ -22,9 +22,23 @@ schema { query: Query } -"The node interface is implemented by entities that have a global unique identifier." -interface Node { - id: ID! +type Query { + "Fetches an object given its ID." + node("ID of the object." id: ID!): Node + "Lookup nodes by a list of IDs." + nodes("The list of node IDs." ids: [ID!]!): [Node]! + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: BookFilterInput + order: [BookSortInput!] + ): BooksConnection } type Author { @@ -81,23 +95,9 @@ type Publisher { authors: [Author!]! } -type Query { - "Fetches an object given its ID." - node("ID of the object." id: ID!): Node - "Lookup nodes by a list of IDs." - nodes("The list of node IDs." ids: [ID!]!): [Node]! - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: BookFilterInput - order: [BookSortInput!] - ): BooksConnection +"The node interface is implemented by entities that have a global unique identifier." +interface Node { + id: ID! } input AuthorFilterInput { diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Execute_And_OnRoot.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Execute_And_OnRoot.snap index 8a418a84d75..9696bb468bd 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Execute_And_OnRoot.snap +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Execute_And_OnRoot.snap @@ -19,6 +19,21 @@ schema { query: DifferentScope } +type DifferentScope { + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: Foo_BookFilterInput + order: [Foo_BookSortInput!] + ): BooksConnection +} + type Author { id: Int! name: String @@ -52,21 +67,6 @@ type BooksEdge { node: Book! } -type DifferentScope { - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: Foo_BookFilterInput - order: [Foo_BookSortInput!] - ): BooksConnection -} - "Information about pagination in a connection." type PageInfo { "Indicates whether more edges exist following the set defined by the clients arguments." diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Execute_And_OnRoot_Reverse.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Execute_And_OnRoot_Reverse.snap index 8a418a84d75..9696bb468bd 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Execute_And_OnRoot_Reverse.snap +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Execute_And_OnRoot_Reverse.snap @@ -19,6 +19,21 @@ schema { query: DifferentScope } +type DifferentScope { + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: Foo_BookFilterInput + order: [Foo_BookSortInput!] + ): BooksConnection +} + type Author { id: Int! name: String @@ -52,21 +67,6 @@ type BooksEdge { node: Book! } -type DifferentScope { - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: Foo_BookFilterInput - order: [Foo_BookSortInput!] - ): BooksConnection -} - "Information about pagination in a connection." type PageInfo { "Indicates whether more edges exist following the set defined by the clients arguments." diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Schema_Should_Generate_WhenMutationInputHasManyToManyRelationshipWithOutputType.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Schema_Should_Generate_WhenMutationInputHasManyToManyRelationshipWithOutputType.snap index e8b76c29efe..8e28ad4eeed 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Schema_Should_Generate_WhenMutationInputHasManyToManyRelationshipWithOutputType.snap +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Schema_Should_Generate_WhenMutationInputHasManyToManyRelationshipWithOutputType.snap @@ -3,6 +3,14 @@ schema { mutation: FirstOrDefaultMutationManyToMany } +type FirstOrDefaultQuery { + books(book: BookInput!): Book +} + +type FirstOrDefaultMutationManyToMany { + addPublisher(publisher: PublisherInput!): Author +} + type Author { id: Int! name: String @@ -18,14 +26,6 @@ type Book { publisher: Publisher } -type FirstOrDefaultMutationManyToMany { - addPublisher(publisher: PublisherInput!): Author -} - -type FirstOrDefaultQuery { - books(book: BookInput!): Book -} - type Publisher { id: Int! name: String! diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Schema_Should_Generate_WhenMutationInputHasManyToOneRelationshipWithOutputType.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Schema_Should_Generate_WhenMutationInputHasManyToOneRelationshipWithOutputType.snap index 6d8f89f7112..2aa4534b556 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Schema_Should_Generate_WhenMutationInputHasManyToOneRelationshipWithOutputType.snap +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Schema_Should_Generate_WhenMutationInputHasManyToOneRelationshipWithOutputType.snap @@ -3,6 +3,14 @@ schema { mutation: FirstOrDefaultMutationManyToOne } +type FirstOrDefaultQuery { + books(book: BookInput!): Book +} + +type FirstOrDefaultMutationManyToOne { + addBook(book: BookInput!): Author +} + type Author { id: Int! name: String @@ -18,14 +26,6 @@ type Book { publisher: Publisher } -type FirstOrDefaultMutationManyToOne { - addBook(book: BookInput!): Author -} - -type FirstOrDefaultQuery { - books(book: BookInput!): Book -} - type Publisher { id: Int! name: String! diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Schema_Should_Generate_WhenStaticTypeExtensionWithOffsetPagingOnStaticResolver.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Schema_Should_Generate_WhenStaticTypeExtensionWithOffsetPagingOnStaticResolver.snap index f47f75f463e..8b8c7805b3e 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Schema_Should_Generate_WhenStaticTypeExtensionWithOffsetPagingOnStaticResolver.snap +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/IntegrationTests.Schema_Should_Generate_WhenStaticTypeExtensionWithOffsetPagingOnStaticResolver.snap @@ -2,6 +2,10 @@ schema { query: Query } +type Query { + bars(skip: Int, take: Int): BarsCollectionSegment +} + type Bar { qux: String! } @@ -21,7 +25,3 @@ type CollectionSegmentInfo { "Indicates whether more items exist prior the set defined by the clients arguments." hasPreviousPage: Boolean! } - -type Query { - bars(skip: Int, take: Int): BarsCollectionSegment -} diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceFieldFilterAndSortTests.Interface_Field_Schema_Snapshot.graphql b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceFieldFilterAndSortTests.Interface_Field_Schema_Snapshot.graphql index 97ee75b0964..99c67be0fc0 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceFieldFilterAndSortTests.Interface_Field_Schema_Snapshot.graphql +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceFieldFilterAndSortTests.Interface_Field_Schema_Snapshot.graphql @@ -2,20 +2,8 @@ schema { query: Query } -interface Person { - friends( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: PersonFilterInput - order: [PersonSortInput!] - ): FriendsConnection - name: String! +type Query { + person: Person! } type Author implements Person { @@ -64,8 +52,20 @@ type PageInfo { endCursor: String } -type Query { - person: Person! +interface Person { + friends( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: PersonFilterInput + order: [PersonSortInput!] + ): FriendsConnection + name: String! } input PersonFilterInput { diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/TypeValidationTests.EnsureCorrectlyOrderedMiddlewarePassValidation.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/TypeValidationTests.EnsureCorrectlyOrderedMiddlewarePassValidation.snap index bebf76dba8b..2cf9b3b0b4a 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/TypeValidationTests.EnsureCorrectlyOrderedMiddlewarePassValidation.snap +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/TypeValidationTests.EnsureCorrectlyOrderedMiddlewarePassValidation.snap @@ -2,6 +2,21 @@ schema { query: CorrectMiddlewarePipeline } +type CorrectMiddlewarePipeline { + bars( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + where: FooFilterInput + order: [FooSortInput!] + ): BarsConnection +} + "A connection to a list of items." type BarsConnection { "Information to aid in pagination." @@ -20,21 +35,6 @@ type BarsEdge { node: Foo! } -type CorrectMiddlewarePipeline { - bars( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - where: FooFilterInput - order: [FooSortInput!] - ): BarsConnection -} - type Foo { bar: String } diff --git a/src/HotChocolate/Fusion/src/Fusion.Composition.ApolloFederation/FederationSchemaTransformer.cs b/src/HotChocolate/Fusion/src/Fusion.Composition.ApolloFederation/FederationSchemaTransformer.cs index 7d62015057d..9058b9d6771 100644 --- a/src/HotChocolate/Fusion/src/Fusion.Composition.ApolloFederation/FederationSchemaTransformer.cs +++ b/src/HotChocolate/Fusion/src/Fusion.Composition.ApolloFederation/FederationSchemaTransformer.cs @@ -2,6 +2,7 @@ using HotChocolate.Fusion.Errors; using HotChocolate.Fusion.Results; using HotChocolate.Language; +using HotChocolate.Serialization; using HotChocolate.Types.Mutable; using HotChocolate.Types.Mutable.Serialization; using static HotChocolate.Fusion.ApolloFederation.Properties.FederationResources; diff --git a/src/HotChocolate/Fusion/src/Fusion.Connectors.InMemory/InMemoryConfigurationProvider.cs b/src/HotChocolate/Fusion/src/Fusion.Connectors.InMemory/InMemoryConfigurationProvider.cs index e4ecfbdc126..e286c72be13 100644 --- a/src/HotChocolate/Fusion/src/Fusion.Connectors.InMemory/InMemoryConfigurationProvider.cs +++ b/src/HotChocolate/Fusion/src/Fusion.Connectors.InMemory/InMemoryConfigurationProvider.cs @@ -134,7 +134,7 @@ private async Task ComposeLoopAsync(CancellationToken ct) for (var i = 0; i < _proxies.Length; i++) { var executor = await _proxies[i].GetExecutorAsync(ct).ConfigureAwait(false); - var sdl = SchemaPrinter.Print((Schema)executor.Schema); + var sdl = executor.Schema.ToString(); sourceSchemas[i] = new SourceSchemaText(_schemaNames[i], sdl); } diff --git a/src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionDirectiveDefinition.cs b/src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionDirectiveDefinition.cs index 2f18eda2cc4..c9478381a8a 100644 --- a/src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionDirectiveDefinition.cs +++ b/src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionDirectiveDefinition.cs @@ -64,6 +64,13 @@ public FusionDirectiveDefinition( /// public bool IsRepeatable { get; } + /// + /// Defines if this directive is publicly visible through introspection + /// and external SDL output. Internal directives are part of the type system + /// but hidden from external observers. + /// + public bool IsPublic { get; init; } = true; + /// /// Gets the arguments that are defined on this directive. /// diff --git a/src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionSchemaDefinition.cs b/src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionSchemaDefinition.cs index cff3fdf5f1d..d5600515233 100644 --- a/src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionSchemaDefinition.cs +++ b/src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionSchemaDefinition.cs @@ -501,7 +501,7 @@ public DocumentNode ToSyntaxNode() => SchemaFormatter.FormatAsDocument(this); ISyntaxNode ISyntaxNodeProvider.ToSyntaxNode() - => SchemaFormatter.FormatAsDocument(this); + => ToSyntaxNode(); public async ValueTask DisposeAsync() { diff --git a/src/HotChocolate/Fusion/src/Fusion.Execution.Types/Serialization/SchemaFormatterOptions.cs b/src/HotChocolate/Fusion/src/Fusion.Execution.Types/Serialization/SchemaFormatterOptions.cs deleted file mode 100644 index 7e36d8f5196..00000000000 --- a/src/HotChocolate/Fusion/src/Fusion.Execution.Types/Serialization/SchemaFormatterOptions.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace HotChocolate.Types.Mutable.Serialization; - -public struct SchemaFormatterOptions -{ - public bool? OrderByName { get; set; } - - public bool? Indented { get; set; } - - public bool? PrintSpecScalars { get; set; } - - public bool? PrintSpecDirectives { get; set; } -} diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type.yaml index 6c908c3bb8a..ceaa64d8b03 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type.yaml @@ -29,8 +29,21 @@ sourceSchemas: query: Query } - interface SharedType @key(fields: "id") { - id: Int! + type Query { + abstractType: SharedType! + otherAbstractType: SharedType! + abstractTypes: [SharedType!]! + interfaceConnection( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): InterfaceConnectionConnection + authorById(id: Int!): Author @lookup } type Author implements SharedType { @@ -77,21 +90,8 @@ sourceSchemas: id: Int! } - type Query { - abstractType: SharedType! - otherAbstractType: SharedType! - abstractTypes: [SharedType!]! - interfaceConnection( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): InterfaceConnectionConnection - authorById(id: Int!): Author @lookup + interface SharedType @key(fields: "id") { + id: Int! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_Direct_Source_Schema_Call.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_Direct_Source_Schema_Call.yaml index 007ee5b5c8d..60890d2c584 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_Direct_Source_Schema_Call.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_Direct_Source_Schema_Call.yaml @@ -38,8 +38,21 @@ sourceSchemas: query: Query } - interface SharedType @key(fields: "id") { - id: Int! + type Query { + abstractType: SharedType! + otherAbstractType: SharedType! + abstractTypes: [SharedType!]! + interfaceConnection( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): InterfaceConnectionConnection + authorById(id: Int!): Author @lookup } type Author implements SharedType { @@ -82,21 +95,8 @@ sourceSchemas: endCursor: String } - type Query { - abstractType: SharedType! - otherAbstractType: SharedType! - abstractTypes: [SharedType!]! - interfaceConnection( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): InterfaceConnectionConnection - authorById(id: Int!): Author @lookup + interface SharedType @key(fields: "id") { + id: Int! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Abstract_Lookup.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Abstract_Lookup.yaml index 4c9a3ade5b5..c37fbd4c8da 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Abstract_Lookup.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Abstract_Lookup.yaml @@ -28,8 +28,21 @@ sourceSchemas: query: Query } - interface SharedType @key(fields: "id") { - id: Int! + type Query { + abstractType: SharedType! + otherAbstractType: SharedType! + abstractTypes: [SharedType!]! + interfaceConnection( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): InterfaceConnectionConnection + authorById(id: Int!): Author @lookup } type Author implements SharedType { @@ -76,21 +89,8 @@ sourceSchemas: id: Int! } - type Query { - abstractType: SharedType! - otherAbstractType: SharedType! - abstractTypes: [SharedType!]! - interfaceConnection( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): InterfaceConnectionConnection - authorById(id: Int!): Author @lookup + interface SharedType @key(fields: "id") { + id: Int! } interactions: - request: @@ -124,8 +124,9 @@ sourceSchemas: query: Query } - interface OtherInterface { - id: Int! + type Query { + otherInterface(id: Int!): OtherInterface @lookup + discussionById(id: ID!): Discussion @lookup @internal } type Author implements OtherInterface { @@ -138,9 +139,8 @@ sourceSchemas: commentCount: Int! } - type Query { - otherInterface(id: Int!): OtherInterface @lookup - discussionById(id: ID!): Discussion @lookup @internal + interface OtherInterface { + id: Int! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Concrete_Lookup.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Concrete_Lookup.yaml index be90c2f8474..b2d57177142 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Concrete_Lookup.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Concrete_Lookup.yaml @@ -28,8 +28,21 @@ sourceSchemas: query: Query } - interface SharedType @key(fields: "id") { - id: Int! + type Query { + abstractType: SharedType! + otherAbstractType: SharedType! + abstractTypes: [SharedType!]! + interfaceConnection( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): InterfaceConnectionConnection + authorById(id: Int!): Author @lookup } type Author implements SharedType { @@ -76,21 +89,8 @@ sourceSchemas: id: Int! } - type Query { - abstractType: SharedType! - otherAbstractType: SharedType! - abstractTypes: [SharedType!]! - interfaceConnection( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): InterfaceConnectionConnection - authorById(id: Int!): Author @lookup + interface SharedType @key(fields: "id") { + id: Int! } interactions: - request: @@ -124,8 +124,9 @@ sourceSchemas: query: Query } - interface OtherInterface { - id: Int! + type Query { + otherInterface(id: Int!): OtherInterface @lookup + discussionById(id: ID!): Discussion @lookup @internal } type Author implements OtherInterface { @@ -138,9 +139,8 @@ sourceSchemas: commentCount: Int! } - type Query { - otherInterface(id: Int!): OtherInterface @lookup - discussionById(id: ID!): Discussion @lookup @internal + interface OtherInterface { + id: Int! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Concrete_Type_With_Abstract_Lookup.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Concrete_Type_With_Abstract_Lookup.yaml index 1ac5d1ecca0..610cbc6ee07 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Concrete_Type_With_Abstract_Lookup.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Concrete_Type_With_Abstract_Lookup.yaml @@ -24,8 +24,21 @@ sourceSchemas: query: Query } - interface SharedType @key(fields: "id") { - id: Int! + type Query { + abstractType: SharedType! + otherAbstractType: SharedType! + abstractTypes: [SharedType!]! + interfaceConnection( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): InterfaceConnectionConnection + authorById(id: Int!): Author @lookup } type Author implements SharedType { @@ -72,21 +85,8 @@ sourceSchemas: id: Int! } - type Query { - abstractType: SharedType! - otherAbstractType: SharedType! - abstractTypes: [SharedType!]! - interfaceConnection( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): InterfaceConnectionConnection - authorById(id: Int!): Author @lookup + interface SharedType @key(fields: "id") { + id: Int! } interactions: - request: @@ -115,8 +115,9 @@ sourceSchemas: query: Query } - interface OtherInterface { - id: Int! + type Query { + otherInterface(id: Int!): OtherInterface @lookup + discussionById(id: ID!): Discussion @lookup @internal } type Author implements OtherInterface { @@ -129,9 +130,8 @@ sourceSchemas: commentCount: Int! } - type Query { - otherInterface(id: Int!): OtherInterface @lookup - discussionById(id: ID!): Discussion @lookup @internal + interface OtherInterface { + id: Int! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_Aliased_With_Different_Selections.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_Aliased_With_Different_Selections.yaml index cd7b437502f..cf59019d944 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_Aliased_With_Different_Selections.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_Aliased_With_Different_Selections.yaml @@ -51,25 +51,25 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + abstractTypes: [Votable] + node(id: ID!): Node @lookup @shareable } - interface Votable @key(fields: "id") { + type Author implements Votable & Node @key(fields: "id") { id: ID! } - type Author implements Votable & Node @key(fields: "id") { + type Discussion implements Votable & Node @key(fields: "id") { id: ID! } - type Discussion implements Votable & Node @key(fields: "id") { + interface Node { id: ID! } - type Query { - abstractTypes: [Votable] - node(id: ID!): Node @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! } interactions: - request: @@ -130,25 +130,25 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(id: ID!): Discussion @lookup @shareable } - interface Votable @key(fields: "id") { + type Discussion implements Votable & Node @key(fields: "id") { id: ID! upvotes: Int! score: Int! } - type Discussion implements Votable & Node @key(fields: "id") { + interface Node { id: ID! - upvotes: Int! - score: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(id: ID!): Discussion @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! + upvotes: Int! + score: Int! } interactions: - request: @@ -198,25 +198,25 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + authorById(id: ID!): Author @lookup @shareable } - interface Votable @key(fields: "id") { + type Author implements Votable & Node @key(fields: "id") { id: ID! upvotes: Int! score: Int! } - type Author implements Votable & Node @key(fields: "id") { + interface Node { id: ID! - upvotes: Int! - score: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - authorById(id: ID!): Author @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! + upvotes: Int! + score: Int! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_All_Fields_On_Dedicated_Schemas.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_All_Fields_On_Dedicated_Schemas.yaml index da02cb9cdf6..00b03646e2d 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_All_Fields_On_Dedicated_Schemas.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_All_Fields_On_Dedicated_Schemas.yaml @@ -39,25 +39,25 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + abstractTypes: [Votable] + node(id: ID!): Node @lookup @shareable } - interface Votable @key(fields: "id") { + type Author implements Votable & Node @key(fields: "id") { id: ID! } - type Author implements Votable & Node @key(fields: "id") { + type Discussion implements Votable & Node @key(fields: "id") { id: ID! } - type Discussion implements Votable & Node @key(fields: "id") { + interface Node { id: ID! } - type Query { - abstractTypes: [Votable] - node(id: ID!): Node @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! } interactions: - request: @@ -96,25 +96,25 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(id: ID!): Discussion @lookup @shareable } - interface Votable @key(fields: "id") { + type Discussion implements Votable & Node @key(fields: "id") { id: ID! upvotes: Int! score: Int! } - type Discussion implements Votable & Node @key(fields: "id") { + interface Node { id: ID! - upvotes: Int! - score: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(id: ID!): Discussion @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! + upvotes: Int! + score: Int! } interactions: - request: @@ -164,25 +164,25 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + authorById(id: ID!): Author @lookup @shareable } - interface Votable @key(fields: "id") { + type Author implements Votable & Node @key(fields: "id") { id: ID! upvotes: Int! score: Int! } - type Author implements Votable & Node @key(fields: "id") { + interface Node { id: ID! - upvotes: Int! - score: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - authorById(id: ID!): Author @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! + upvotes: Int! + score: Int! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_Type_Refinements_Do_Not_Match.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_Type_Refinements_Do_Not_Match.yaml index f2041553cd9..2e28d6b2924 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_Type_Refinements_Do_Not_Match.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_With_And_Without_Type_Refinements_Type_Refinements_Do_Not_Match.yaml @@ -35,25 +35,25 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + abstractTypes: [Votable] + node(id: ID!): Node @lookup @shareable } - interface Votable @key(fields: "id") { + type Author implements Votable & Node @key(fields: "id") { id: ID! } - type Author implements Votable & Node @key(fields: "id") { + type Discussion implements Votable & Node @key(fields: "id") { id: ID! } - type Discussion implements Votable & Node @key(fields: "id") { + interface Node { id: ID! } - type Query { - abstractTypes: [Votable] - node(id: ID!): Node @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! } interactions: - request: @@ -92,24 +92,24 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(id: ID!): Discussion @lookup @shareable } - interface Votable @key(fields: "id") { + type Discussion implements Votable & Node @key(fields: "id") { id: ID! upvotes: Int! + score: Int! } - type Discussion implements Votable & Node @key(fields: "id") { + interface Node { id: ID! - upvotes: Int! - score: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(id: ID!): Discussion @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! + upvotes: Int! } interactions: - request: @@ -159,23 +159,23 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + authorById(id: ID!): Author @lookup @shareable } - interface Votable @key(fields: "id") { + type Author implements Votable & Node @key(fields: "id") { id: ID! upvotes: Int! } - type Author implements Votable & Node @key(fields: "id") { + interface Node { id: ID! - upvotes: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - authorById(id: ID!): Author @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! + upvotes: Int! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Concrete_Lookups.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Concrete_Lookups.yaml index 23f0525bf78..a2760db2835 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Concrete_Lookups.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Concrete_Lookups.yaml @@ -24,8 +24,8 @@ sourceSchemas: query: Query } - interface Votable @key(fields: "id") { - id: ID! + type Query { + votable: Votable } type Comment implements Votable @key(fields: "id") { @@ -36,8 +36,8 @@ sourceSchemas: id: ID! } - type Query { - votable: Votable + interface Votable @key(fields: "id") { + id: ID! } interactions: - request: @@ -66,9 +66,9 @@ sourceSchemas: query: Query } - interface Votable { - id: ID! - viewerCanVote: Boolean! + type Query { + discussionById(id: ID!): Discussion @lookup + commentById(id: ID!): Comment @lookup } type Comment implements Votable { @@ -81,9 +81,9 @@ sourceSchemas: viewerCanVote: Boolean! } - type Query { - discussionById(id: ID!): Discussion @lookup - commentById(id: ID!): Comment @lookup + interface Votable { + id: ID! + viewerCanVote: Boolean! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Concrete_Lookups_And_Field_From_Specific_Source.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Concrete_Lookups_And_Field_From_Specific_Source.yaml index 5a575c9c9ae..f94994372e5 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Concrete_Lookups_And_Field_From_Specific_Source.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Concrete_Lookups_And_Field_From_Specific_Source.yaml @@ -24,8 +24,8 @@ sourceSchemas: query: Query } - interface Votable @key(fields: "id") { - id: ID! + type Query { + votable: Votable } type Comment implements Votable @key(fields: "id") { @@ -36,8 +36,8 @@ sourceSchemas: id: ID! } - type Query { - votable: Votable + interface Votable @key(fields: "id") { + id: ID! } interactions: - request: @@ -66,9 +66,9 @@ sourceSchemas: query: Query } - interface Votable { - id: ID! - viewerCanVote: Boolean! + type Query { + discussionById(id: ID!): Discussion @lookup @shareable + commentById(id: ID!): Comment @lookup @shareable } type Comment implements Votable { @@ -81,9 +81,9 @@ sourceSchemas: viewerCanVote: Boolean! } - type Query { - discussionById(id: ID!): Discussion @lookup @shareable - commentById(id: ID!): Comment @lookup @shareable + interface Votable { + id: ID! + viewerCanVote: Boolean! } - name: C schema: | @@ -91,9 +91,9 @@ sourceSchemas: query: Query } - interface Votable { - id: ID! - totalVotes: Int! + type Query { + discussionById(id: ID!): Discussion @lookup @shareable + commentById(id: ID!): Comment @lookup @shareable } type Comment implements Votable { @@ -106,9 +106,9 @@ sourceSchemas: totalVotes: Int! } - type Query { - discussionById(id: ID!): Discussion @lookup @shareable - commentById(id: ID!): Comment @lookup @shareable + interface Votable { + id: ID! + totalVotes: Int! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Interface_Lookup.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Interface_Lookup.yaml index 43be4252d9b..01a5454ae99 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Interface_Lookup.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Interface_Lookup.yaml @@ -24,16 +24,16 @@ sourceSchemas: query: Query } - interface Votable @key(fields: "id") { - id: ID! + type Query { + votable: Votable } type Discussion implements Votable @key(fields: "id") { id: ID! } - type Query { - votable: Votable + interface Votable @key(fields: "id") { + id: ID! } interactions: - request: @@ -62,9 +62,8 @@ sourceSchemas: query: Query } - interface Votable { - id: ID! - viewerCanVote: Boolean! + type Query { + votableById(id: ID!): Votable @lookup } type Discussion implements Votable { @@ -72,8 +71,9 @@ sourceSchemas: viewerCanVote: Boolean! } - type Query { - votableById(id: ID!): Votable @lookup + interface Votable { + id: ID! + viewerCanVote: Boolean! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Interface_Lookup_And_Field_From_Specific_Source.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Interface_Lookup_And_Field_From_Specific_Source.yaml index 27a3584eaf6..0f183c8ed52 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Interface_Lookup_And_Field_From_Specific_Source.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Interface_Field_Without_Type_Refinements_With_Interface_Lookup_And_Field_From_Specific_Source.yaml @@ -24,16 +24,16 @@ sourceSchemas: query: Query } - interface Votable @key(fields: "id") { - id: ID! + type Query { + votable: Votable } type Discussion implements Votable @key(fields: "id") { id: ID! } - type Query { - votable: Votable + interface Votable @key(fields: "id") { + id: ID! } interactions: - request: @@ -62,9 +62,8 @@ sourceSchemas: query: Query } - interface Votable { - id: ID! - viewerCanVote: Boolean! + type Query { + votableById(id: ID!): Votable @lookup @shareable } type Discussion implements Votable { @@ -72,8 +71,9 @@ sourceSchemas: viewerCanVote: Boolean! } - type Query { - votableById(id: ID!): Votable @lookup @shareable + interface Votable { + id: ID! + viewerCanVote: Boolean! } - name: C schema: | @@ -81,9 +81,8 @@ sourceSchemas: query: Query } - interface Votable { - id: ID! - totalVotes: Int! + type Query { + votableById(id: ID!): Votable @lookup @shareable } type Discussion implements Votable { @@ -91,8 +90,9 @@ sourceSchemas: totalVotes: Int! } - type Query { - votableById(id: ID!): Votable @lookup @shareable + interface Votable { + id: ID! + totalVotes: Int! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.List_Of_Abstract_Types.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.List_Of_Abstract_Types.yaml index 7d4b9f37461..3341591cce2 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.List_Of_Abstract_Types.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.List_Of_Abstract_Types.yaml @@ -38,8 +38,21 @@ sourceSchemas: query: Query } - interface SharedType @key(fields: "id") { - id: Int! + type Query { + abstractType: SharedType! + otherAbstractType: SharedType! + abstractTypes: [SharedType!]! + interfaceConnection( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): InterfaceConnectionConnection + authorById(id: Int!): Author @lookup } type Author implements SharedType { @@ -86,21 +99,8 @@ sourceSchemas: id: Int! } - type Query { - abstractType: SharedType! - otherAbstractType: SharedType! - abstractTypes: [SharedType!]! - interfaceConnection( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): InterfaceConnectionConnection - authorById(id: Int!): Author @lookup + interface SharedType @key(fields: "id") { + id: Int! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Concrete_Lookups.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Concrete_Lookups.yaml index 6ea0f2b36b1..35f64769466 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Concrete_Lookups.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Concrete_Lookups.yaml @@ -27,14 +27,14 @@ sourceSchemas: query: Query } - type Product @key(fields: "id") { - id: ID! - } - type Query { search: SearchResult } + type Product @key(fields: "id") { + id: ID! + } + type User @key(fields: "id") { id: ID! } @@ -72,16 +72,16 @@ sourceSchemas: query: Query } - type Product { - id: ID! - price: Float! - } - type Query { userById(id: ID!): User @lookup @shareable productById(id: ID!): Product @lookup } + type Product { + id: ID! + price: Float! + } + type User { id: ID! reputation: Int! diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Concrete_Lookups_With_Additional_Concrete_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Concrete_Lookups_With_Additional_Concrete_Dependency.yaml index a24a9f62e5e..14220f0f70b 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Concrete_Lookups_With_Additional_Concrete_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Concrete_Lookups_With_Additional_Concrete_Dependency.yaml @@ -29,14 +29,14 @@ sourceSchemas: query: Query } - type Product @key(fields: "id") { - id: ID! - } - type Query { search: SearchResult } + type Product @key(fields: "id") { + id: ID! + } + type User @key(fields: "id") { id: ID! } @@ -74,16 +74,16 @@ sourceSchemas: query: Query } - type Product { - id: ID! - price: Float! - } - type Query { userById(id: ID!): User @lookup @shareable productById(id: ID!): Product @lookup } + type Product { + id: ID! + price: Float! + } + type User { id: ID! reputation: Int! diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Union_Lookup.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Union_Lookup.yaml index 54ef92e82e6..fb1aa68a00e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Union_Lookup.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Union_Lookup.yaml @@ -27,14 +27,14 @@ sourceSchemas: query: Query } - type Product @key(fields: "id") { - id: ID! - } - type Query { search: SearchResult } + type Product @key(fields: "id") { + id: ID! + } + type User @key(fields: "id") { id: ID! } @@ -72,15 +72,15 @@ sourceSchemas: query: Query } + type Query { + searchResultById(id: ID!): SearchResult @lookup + } + type Product { id: ID! price: Float! } - type Query { - searchResultById(id: ID!): SearchResult @lookup - } - type User { id: ID! reputation: Int! diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Union_Lookup_With_Additional_Concrete_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Union_Lookup_With_Additional_Concrete_Dependency.yaml index 235359302cc..e8fd28ae017 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Union_Lookup_With_Additional_Concrete_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Union_Field_With_Type_Refinements_And_Union_Lookup_With_Additional_Concrete_Dependency.yaml @@ -29,14 +29,14 @@ sourceSchemas: query: Query } - type Product @key(fields: "id") { - id: ID! - } - type Query { search: SearchResult } + type Product @key(fields: "id") { + id: ID! + } + type User @key(fields: "id") { id: ID! } @@ -74,15 +74,15 @@ sourceSchemas: query: Query } + type Query { + searchResultById(id: ID!): SearchResult @lookup + } + type Product { id: ID! price: Float! } - type Query { - searchResultById(id: ID!): SearchResult @lookup - } - type User { id: ID! reputation: Int! diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ComplexNested.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ComplexNested.yaml index cd668be7045..2fde8fae20c 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ComplexNested.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ComplexNested.yaml @@ -70,23 +70,17 @@ sourceSchemas: LIST } + "The `Any` scalar type represents any valid GraphQL value." + scalar Any + @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) + @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." - directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! - ) on SCALAR - - "The `Any` scalar type represents any valid GraphQL value." - scalar Any - @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) - @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_List.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_List.yaml index ba4417bdb42..69947e45efa 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_List.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_List.yaml @@ -51,23 +51,17 @@ sourceSchemas: LIST } + "The `Any` scalar type represents any valid GraphQL value." + scalar Any + @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) + @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." - directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! - ) on SCALAR - - "The `Any` scalar type represents any valid GraphQL value." - scalar Any - @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) - @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ListOfObjects.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ListOfObjects.yaml index 4ad5fee1d52..28871c0cb09 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ListOfObjects.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ListOfObjects.yaml @@ -58,23 +58,17 @@ sourceSchemas: LIST } + "The `Any` scalar type represents any valid GraphQL value." + scalar Any + @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) + @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." - directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! - ) on SCALAR - - "The `Any` scalar type represents any valid GraphQL value." - scalar Any - @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) - @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NestedObject.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NestedObject.yaml index 84ee2661250..086614f1815 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NestedObject.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NestedObject.yaml @@ -52,23 +52,17 @@ sourceSchemas: LIST } + "The `Any` scalar type represents any valid GraphQL value." + scalar Any + @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) + @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." - directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! - ) on SCALAR - - "The `Any` scalar type represents any valid GraphQL value." - scalar Any - @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) - @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NullValue.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NullValue.yaml index c40f9d66965..3396a4c3476 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NullValue.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_NullValue.yaml @@ -45,23 +45,17 @@ sourceSchemas: LIST } + "The `Any` scalar type represents any valid GraphQL value." + scalar Any + @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) + @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." - directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! - ) on SCALAR - - "The `Any` scalar type represents any valid GraphQL value." - scalar Any - @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) - @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_Object.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_Object.yaml index 0abda54e306..ab04a5f6cc2 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_Object.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_Object.yaml @@ -47,23 +47,17 @@ sourceSchemas: LIST } + "The `Any` scalar type represents any valid GraphQL value." + scalar Any + @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) + @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." - directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! - ) on SCALAR - - "The `Any` scalar type represents any valid GraphQL value." - scalar Any - @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) - @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ObjectWithLists.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ObjectWithLists.yaml index 04117d5dedd..c24e574b090 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ObjectWithLists.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_ObjectWithLists.yaml @@ -57,23 +57,17 @@ sourceSchemas: LIST } + "The `Any` scalar type represents any valid GraphQL value." + scalar Any + @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) + @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." - directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! - ) on SCALAR - - "The `Any` scalar type represents any valid GraphQL value." - scalar Any - @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) - @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_SimpleValues.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_SimpleValues.yaml index 06b698c0613..b205836eaf9 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_SimpleValues.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/AnyScalarTests.Handle_Any_Scalar_SimpleValues.yaml @@ -51,23 +51,17 @@ sourceSchemas: LIST } + "The `Any` scalar type represents any valid GraphQL value." + scalar Any + @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) + @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." - directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! - ) on SCALAR - - "The `Any` scalar type represents any valid GraphQL value." - scalar Any - @serializeAs(type: [STRING, BOOLEAN, INT, FLOAT, OBJECT, LIST]) - @specifiedBy(url: "https://scalars.graphql.org/chillicream/any.html") interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Ensure_String_Literals_Can_Be_Empty.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Ensure_String_Literals_Can_Be_Empty.yaml index 8cdf63ff05c..7f4b54e3764 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Ensure_String_Literals_Can_Be_Empty.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Ensure_String_Literals_Can_Be_Empty.yaml @@ -18,6 +18,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + formatTitle(title: String!): String! + } + type Author @key(fields: "id") { id: Int! } @@ -57,21 +72,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @lookup - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - formatTitle(title: String!): String! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -93,6 +93,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + authorById(id: Int!): Author @internal @lookup + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + } + type Author { books: [Book!]! id: Int! @@ -134,21 +149,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @internal @lookup - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Ensure_String_Variables_Can_Be_Empty.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Ensure_String_Variables_Can_Be_Empty.yaml index 2ec7e2ddec4..7dc13c9f46d 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Ensure_String_Variables_Can_Be_Empty.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Ensure_String_Variables_Can_Be_Empty.yaml @@ -22,6 +22,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + formatTitle(title: String!): String! + } + type Author @key(fields: "id") { id: Int! } @@ -61,21 +76,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @lookup - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - formatTitle(title: String!): String! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -101,6 +101,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + authorById(id: Int!): Author @internal @lookup + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + } + type Author { books: [Book!]! id: Int! @@ -142,21 +157,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @internal @lookup - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1.yaml index 748c5b1ec44..bbc9b24d842 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1.yaml @@ -24,6 +24,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + formatTitle(title: String!): String! + } + type Author @key(fields: "id") { id: Int! } @@ -63,21 +78,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @lookup - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - formatTitle(title: String!): String! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -105,6 +105,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + authorById(id: Int!): Author @internal @lookup + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + } + type Author { books: [Book!]! id: Int! @@ -146,21 +161,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @internal @lookup - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1_And_Author_From_SourceSchema2.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1_And_Author_From_SourceSchema2.yaml index 0357d699b41..d37c83cb5f7 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1_And_Author_From_SourceSchema2.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1_And_Author_From_SourceSchema2.yaml @@ -28,6 +28,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + formatTitle(title: String!): String! + } + type Author @key(fields: "id") { id: Int! } @@ -67,21 +82,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @lookup - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - formatTitle(title: String!): String! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -113,6 +113,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + authorById(id: Int!): Author @internal @lookup + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + } + type Author { books: [Book!]! id: Int! @@ -154,21 +169,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @internal @lookup - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1_Two_Requests.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1_Two_Requests.yaml index d4474293924..ad20d5e87d7 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1_Two_Requests.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1_Two_Requests.yaml @@ -24,6 +24,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + formatTitle(title: String!): String! + } + type Author @key(fields: "id") { id: Int! } @@ -63,21 +78,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @lookup - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - formatTitle(title: String!): String! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -105,6 +105,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + authorById(id: Int!): Author @internal @lookup + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + } + type Author { books: [Book!]! id: Int! @@ -146,21 +161,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @internal @lookup - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1_With_Settings.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1_With_Settings.yaml index 5734c02b0d3..2e047d4486b 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1_With_Settings.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Book_From_SourceSchema1_With_Settings.yaml @@ -24,6 +24,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + formatTitle(title: String!): String! + } + type Author @key(fields: "id") { id: Int! } @@ -63,10 +78,16 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } + - name: b + schema: | + schema { + query: Query + } type Query { - bookById(id: Int!): Book @lookup - books( + bookById(id: Int!): Book @internal @lookup + authorById(id: Int!): Author @internal @lookup + authors( "Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." @@ -75,13 +96,7 @@ sourceSchemas: last: Int "Returns the elements in the list that come before the specified cursor." before: String - ): BooksConnection - formatTitle(title: String!): String! - } - - name: b - schema: | - schema { - query: Query + ): AuthorsConnection } type Author { @@ -125,21 +140,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @internal @lookup - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_From_SourceSchema1_And_Authors_From_SourceSchema2.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_From_SourceSchema1_And_Authors_From_SourceSchema2.yaml index bc409898494..e2ba10d4d88 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_From_SourceSchema1_And_Authors_From_SourceSchema2.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_From_SourceSchema1_And_Authors_From_SourceSchema2.yaml @@ -57,6 +57,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + formatTitle(title: String!): String! + } + type Author @key(fields: "id") { id: Int! } @@ -96,21 +111,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @lookup - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - formatTitle(title: String!): String! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -171,6 +171,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + authorById(id: Int!): Author @internal @lookup + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + } + type Author { books: [Book!]! id: Int! @@ -212,21 +227,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @internal @lookup - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Requirements_To_SourceSchema1.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Requirements_To_SourceSchema1.yaml index e6a3048c570..7c5a0f94f6f 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Requirements_To_SourceSchema1.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Requirements_To_SourceSchema1.yaml @@ -37,6 +37,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + formatTitle(title: String!): String! + } + type Author @key(fields: "id") { id: Int! } @@ -76,21 +91,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @lookup - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - formatTitle(title: String!): String! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -136,6 +136,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + authorById(id: Int!): Author @internal @lookup + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + } + type Author { books: [Book!]! id: Int! @@ -177,21 +192,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @internal @lookup - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Requirements_To_SourceSchema1_Three_Times.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Requirements_To_SourceSchema1_Three_Times.yaml index bd420b59ef0..c3bfe4b8e1b 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Requirements_To_SourceSchema1_Three_Times.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Requirements_To_SourceSchema1_Three_Times.yaml @@ -37,6 +37,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + formatTitle(title: String!): String! + } + type Author @key(fields: "id") { id: Int! } @@ -76,21 +91,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @lookup - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - formatTitle(title: String!): String! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -136,6 +136,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + authorById(id: Int!): Author @internal @lookup + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + } + type Author { books: [Book!]! id: Int! @@ -177,21 +192,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @internal @lookup - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Requirements_To_SourceSchema1_X_Times.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Requirements_To_SourceSchema1_X_Times.yaml index 59a53ac9f67..21f5cafcaa2 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Requirements_To_SourceSchema1_X_Times.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Requirements_To_SourceSchema1_X_Times.yaml @@ -37,6 +37,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + formatTitle(title: String!): String! + } + type Author @key(fields: "id") { id: Int! } @@ -76,21 +91,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @lookup - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - formatTitle(title: String!): String! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -136,6 +136,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + authorById(id: Int!): Author @internal @lookup + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + } + type Author { books: [Book!]! id: Int! @@ -177,21 +192,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @internal @lookup - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Variable_First_And_First_Is_1.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Variable_First_And_First_Is_1.yaml index 4f55bf84f4a..de694979b02 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Variable_First_And_First_Is_1.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Variable_First_And_First_Is_1.yaml @@ -40,6 +40,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + formatTitle(title: String!): String! + } + type Author @key(fields: "id") { id: Int! } @@ -79,21 +94,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @lookup - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - formatTitle(title: String!): String! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -137,6 +137,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + authorById(id: Int!): Author @internal @lookup + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + } + type Author { books: [Book!]! id: Int! @@ -178,21 +193,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @internal @lookup - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Variable_First_And_First_Omitted.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Variable_First_And_First_Omitted.yaml index 2c531b80c0f..1b57065f51f 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Variable_First_And_First_Omitted.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Variable_First_And_First_Omitted.yaml @@ -59,6 +59,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + formatTitle(title: String!): String! + } + type Author @key(fields: "id") { id: Int! } @@ -98,21 +113,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @lookup - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - formatTitle(title: String!): String! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -175,6 +175,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + authorById(id: Int!): Author @internal @lookup + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + } + type Author { books: [Book!]! id: Int! @@ -216,21 +231,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @internal @lookup - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Variable_First_Last_And_First_1_And_Last_Omitted.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Variable_First_Last_And_First_1_And_Last_Omitted.yaml index 6204a4fdb96..42c890de5d3 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Variable_First_Last_And_First_1_And_Last_Omitted.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/BookStoreTests.Fetch_Books_With_Variable_First_Last_And_First_1_And_Last_Omitted.yaml @@ -40,6 +40,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + formatTitle(title: String!): String! + } + type Author @key(fields: "id") { id: Int! } @@ -79,21 +94,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @lookup - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - formatTitle(title: String!): String! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -137,6 +137,21 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + authorById(id: Int!): Author @internal @lookup + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + } + type Author { books: [Book!]! id: Int! @@ -178,21 +193,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @internal @lookup - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/CancellationTests.Http_Request_To_Source_Schema_Hits_HttpClient_Timeout.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/CancellationTests.Http_Request_To_Source_Schema_Hits_HttpClient_Timeout.yaml index 06625cd0795..3ba9b4da2a0 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/CancellationTests.Http_Request_To_Source_Schema_Hits_HttpClient_Timeout.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/CancellationTests.Http_Request_To_Source_Schema_Hits_HttpClient_Timeout.yaml @@ -28,13 +28,13 @@ sourceSchemas: query: Query } - type Product { - id: Int! - } - type Query { topProduct: Product } + + type Product { + id: Int! + } isTimingOut: true interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/CancellationTests.Request_Is_Running_Into_Execution_Timeout_While_Http_Request_In_Node_Is_Still_Ongoing.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/CancellationTests.Request_Is_Running_Into_Execution_Timeout_While_Http_Request_In_Node_Is_Still_Ongoing.yaml index a519b32464c..739e8503e14 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/CancellationTests.Request_Is_Running_Into_Execution_Timeout_While_Http_Request_In_Node_Is_Still_Ongoing.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/CancellationTests.Request_Is_Running_Into_Execution_Timeout_While_Http_Request_In_Node_Is_Still_Ongoing.yaml @@ -25,13 +25,13 @@ sourceSchemas: query: Query } - type Product { - id: Int! - } - type Query { topProduct: Product } + + type Product { + id: Int! + } isTimingOut: true interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.All_Selections_On_A_Field_Statically_Skipped.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.All_Selections_On_A_Field_Statically_Skipped.yaml index 33016902c10..084827d9fdb 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.All_Selections_On_A_Field_Statically_Skipped.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.All_Selections_On_A_Field_Statically_Skipped.yaml @@ -20,14 +20,14 @@ sourceSchemas: query: Query } + type Query { + productBySlug(slug: String!): Product + } + type Product { id: ID! name: String! } - - type Query { - productBySlug(slug: String!): Product - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Interface_Field_With_Type_Refinement_Under_Nested_Skip.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Interface_Field_With_Type_Refinement_Under_Nested_Skip.yaml index 4c33a6aa7ed..a640a410cad 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Interface_Field_With_Type_Refinement_Under_Nested_Skip.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Interface_Field_With_Type_Refinement_Under_Nested_Skip.yaml @@ -45,25 +45,25 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + abstractTypes: [Votable] + node(id: ID!): Node @lookup @shareable } - interface Votable @key(fields: "id") { + type Author implements Votable & Node @key(fields: "id") { id: ID! } - type Author implements Votable & Node @key(fields: "id") { + type Discussion implements Votable & Node @key(fields: "id") { id: ID! } - type Discussion implements Votable & Node @key(fields: "id") { + interface Node { id: ID! } - type Query { - abstractTypes: [Votable] - node(id: ID!): Node @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! } interactions: - request: @@ -116,25 +116,25 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(id: ID!): Discussion @lookup @shareable } - interface Votable @key(fields: "id") { + type Discussion implements Votable & Node @key(fields: "id") { id: ID! upvotes: Int! score: Int! } - type Discussion implements Votable & Node @key(fields: "id") { + interface Node { id: ID! - upvotes: Int! - score: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(id: ID!): Discussion @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! + upvotes: Int! + score: Int! } interactions: - request: @@ -212,25 +212,25 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + authorById(id: ID!): Author @lookup @shareable } - interface Votable @key(fields: "id") { + type Author implements Votable & Node @key(fields: "id") { id: ID! upvotes: Int! score: Int! } - type Author implements Votable & Node @key(fields: "id") { + interface Node { id: ID! - upvotes: Int! - score: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - authorById(id: ID!): Author @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! + upvotes: Int! + score: Int! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Interface_Field_With_Type_Refinement_Under_Skip.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Interface_Field_With_Type_Refinement_Under_Skip.yaml index 80a52c4f71a..faf77c6010e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Interface_Field_With_Type_Refinement_Under_Skip.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Interface_Field_With_Type_Refinement_Under_Skip.yaml @@ -47,25 +47,25 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + abstractTypes: [Votable] + node(id: ID!): Node @lookup @shareable } - interface Votable @key(fields: "id") { + type Author implements Votable & Node @key(fields: "id") { id: ID! } - type Author implements Votable & Node @key(fields: "id") { + type Discussion implements Votable & Node @key(fields: "id") { id: ID! } - type Discussion implements Votable & Node @key(fields: "id") { + interface Node { id: ID! } - type Query { - abstractTypes: [Votable] - node(id: ID!): Node @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! } interactions: - request: @@ -115,25 +115,25 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(id: ID!): Discussion @lookup @shareable } - interface Votable @key(fields: "id") { + type Discussion implements Votable & Node @key(fields: "id") { id: ID! upvotes: Int! score: Int! } - type Discussion implements Votable & Node @key(fields: "id") { + interface Node { id: ID! - upvotes: Int! - score: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(id: ID!): Discussion @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! + upvotes: Int! + score: Int! } interactions: - request: @@ -183,25 +183,25 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + authorById(id: ID!): Author @lookup @shareable } - interface Votable @key(fields: "id") { + type Author implements Votable & Node @key(fields: "id") { id: ID! upvotes: Int! score: Int! } - type Author implements Votable & Node @key(fields: "id") { + interface Node { id: ID! - upvotes: Int! - score: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - authorById(id: ID!): Author @lookup @shareable + interface Votable @key(fields: "id") { + id: ID! + upvotes: Int! + score: Int! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup.yaml index bc75e808033..77a50904e3a 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup.yaml @@ -36,16 +36,16 @@ sourceSchemas: query: Query } + type Query { + productBySlug(slug: String!): Product + } + type Product { id: ID! name: String! review: Review } - type Query { - productBySlug(slug: String!): Product - } - type Review @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup_And_On_Same_Source_Schema.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup_And_On_Same_Source_Schema.yaml index 9e8f40c6e3d..ceb7411626d 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup_And_On_Same_Source_Schema.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup_And_On_Same_Source_Schema.yaml @@ -37,17 +37,17 @@ sourceSchemas: query: Query } + type Query { + productBySlug(slug: String!): Product + reviewById(id: ID!): Review @lookup @shareable + } + type Product { id: ID! name: String! review: Review } - type Query { - productBySlug(slug: String!): Product - reviewById(id: ID!): Review @lookup @shareable - } - type Review { id: ID! author: String! diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Field_With_Requirement_With_Other_Field.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Field_With_Requirement_With_Other_Field.yaml index 6020e879356..b018a5d148e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Field_With_Requirement_With_Other_Field.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Field_With_Requirement_With_Other_Field.yaml @@ -27,13 +27,13 @@ sourceSchemas: query: Query } - type Product @key(fields: "id") { - id: ID! - } - type Query { productBySlug(slug: String!): Product } + + type Product @key(fields: "id") { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -63,29 +63,29 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup @shareable + } + type Product { id: ID! size: Int! } - - type Query { - productById(id: ID!): Product @lookup @shareable - } - name: C schema: | schema { query: Query } + type Query { + productById(id: ID!): Product @lookup @shareable + } + type Product { id: ID! dimension(size: Int! @require(field: "size")): String price: Int! } - - type Query { - productById(id: ID!): Product @lookup @shareable - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Fields_Fetched_Through_Lookup.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Fields_Fetched_Through_Lookup.yaml index 234f9bd8736..4c6086e1c44 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Fields_Fetched_Through_Lookup.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Fields_Fetched_Through_Lookup.yaml @@ -33,16 +33,16 @@ sourceSchemas: query: Query } + type Query { + productBySlug(slug: String!): Product + } + type Product { id: ID! name: String! review: Review } - type Query { - productBySlug(slug: String!): Product - } - type Review @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Not_Only_On_Field_With_Requirement.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Not_Only_On_Field_With_Requirement.yaml index 84ca8d82df3..8836b0165bd 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Not_Only_On_Field_With_Requirement.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Not_Only_On_Field_With_Requirement.yaml @@ -27,13 +27,13 @@ sourceSchemas: query: Query } - type Product { - id: ID! @shareable - } - type Query { productBySlug(slug: String!): Product } + + type Product { + id: ID! @shareable + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -59,29 +59,29 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup @shareable + } + type Product { id: ID! size: Int! } - - type Query { - productById(id: ID!): Product @lookup @shareable - } - name: C schema: | schema { query: Query } + type Query { + productById(id: ID!): Product @lookup @shareable + } + type Product { id: ID! dimension(size: Int! @require(field: "size")): String price: Int! } - - type Query { - productById(id: ID!): Product @lookup @shareable - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_Fetched_Through_Lookup.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_Fetched_Through_Lookup.yaml index b5147dbc8f6..9620251f00a 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_Fetched_Through_Lookup.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_Fetched_Through_Lookup.yaml @@ -30,16 +30,16 @@ sourceSchemas: query: Query } + type Query { + productBySlug(slug: String!): Product + } + type Product { id: ID! name: String! review: Review } - type Query { - productBySlug(slug: String!): Product - } - type Review @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_With_Requirement.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_With_Requirement.yaml index cdb89687779..d82ac7aaaec 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_With_Requirement.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_With_Requirement.yaml @@ -24,13 +24,13 @@ sourceSchemas: query: Query } - type Product { - id: ID! @shareable - } - type Query { productBySlug(slug: String!): Product } + + type Product { + id: ID! @shareable + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -56,28 +56,28 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup @shareable + } + type Product { id: ID! size: Int! } - - type Query { - productById(id: ID!): Product @lookup @shareable - } - name: C schema: | schema { query: Query } + type Query { + productById(id: ID!): Product @lookup @shareable + } + type Product { id: ID! dimension(size: Int! @require(field: "size")): String } - - type Query { - productById(id: ID!): Product @lookup @shareable - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Parent_Field_Of_Field_Fetched_Through_Lookup.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Parent_Field_Of_Field_Fetched_Through_Lookup.yaml index fa3d331b537..d31ee1d88be 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Parent_Field_Of_Field_Fetched_Through_Lookup.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Parent_Field_Of_Field_Fetched_Through_Lookup.yaml @@ -29,16 +29,16 @@ sourceSchemas: query: Query } + type Query { + productBySlug(slug: String!): Product + } + type Product { id: ID! name: String! review: Review } - type Query { - productBySlug(slug: String!): Product - } - type Review @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Only_On_Some_Fields_Fetched_Through_Lookup.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Only_On_Some_Fields_Fetched_Through_Lookup.yaml index 870866eef1a..886af538d5f 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Only_On_Some_Fields_Fetched_Through_Lookup.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Only_On_Some_Fields_Fetched_Through_Lookup.yaml @@ -33,16 +33,16 @@ sourceSchemas: query: Query } + type Query { + productBySlug(slug: String!): Product + } + type Product { id: ID! name: String! review: Review } - type Query { - productBySlug(slug: String!): Product - } - type Review @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Multiple_Skip_Levels_Around_NodeField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Multiple_Skip_Levels_Around_NodeField.yaml index e22ce475181..6c9d813131f 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Multiple_Skip_Levels_Around_NodeField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Multiple_Skip_Levels_Around_NodeField.yaml @@ -28,8 +28,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup } type Discussion implements Node { @@ -37,8 +37,8 @@ sourceSchemas: title: String } - type Query { - node(id: ID!): Node @lookup + interface Node { + id: ID! } operationPlan: operation: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Interface_Type_Refinement.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Interface_Type_Refinement.yaml index 50427e44ad3..953e3594b5f 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Interface_Type_Refinement.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Interface_Type_Refinement.yaml @@ -34,12 +34,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - - interface Votable { - viewerCanVote: Boolean! + type Query { + node(id: ID!): Node @lookup } type Author implements Node & Votable { @@ -54,8 +50,12 @@ sourceSchemas: viewerCanVote: Boolean! } - type Query { - node(id: ID!): Node @lookup + interface Node { + id: ID! + } + + interface Votable { + viewerCanVote: Boolean! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Multiple_Type_Refinements.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Multiple_Type_Refinements.yaml index c76ac1d2ca1..18b49e03107 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Multiple_Type_Refinements.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Multiple_Type_Refinements.yaml @@ -31,8 +31,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Discussion implements Node { @@ -40,8 +40,8 @@ sourceSchemas: title: String } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } interactions: - request: @@ -78,8 +78,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Author implements Node { @@ -87,8 +87,8 @@ sourceSchemas: username: String } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } operationPlan: operation: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_NodeField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_NodeField.yaml index 31702ac8b78..cedd0ae8fa4 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_NodeField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_NodeField.yaml @@ -25,8 +25,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup } type Discussion implements Node { @@ -34,8 +34,8 @@ sourceSchemas: title: String } - type Query { - node(id: ID!): Node @lookup + interface Node { + id: ID! } operationPlan: operation: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Shared_Selections.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Shared_Selections.yaml index 9e0fb392e45..00bfec5c6c5 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Shared_Selections.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Shared_Selections.yaml @@ -31,8 +31,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Discussion implements Node { @@ -40,8 +40,8 @@ sourceSchemas: title: String } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } interactions: - request: @@ -78,8 +78,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Author implements Node { @@ -87,8 +87,8 @@ sourceSchemas: username: String } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } operationPlan: operation: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection.yaml index be0c0cfe814..9da55cd2b5e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection.yaml @@ -33,12 +33,8 @@ sourceSchemas: query: Query } - interface Authorable { - author: Author - } - - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup } type Author implements Node { @@ -51,8 +47,12 @@ sourceSchemas: author: Author } - type Query { - node(id: ID!): Node @lookup + interface Authorable { + author: Author + } + + interface Node { + id: ID! } interactions: - request: @@ -91,15 +91,15 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! username: String rating: Int } - - type Query { - authorById(id: ID!): Author @lookup - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection_Type_Refinement_With_Same_Unskipped_Selection.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection_Type_Refinement_With_Same_Unskipped_Selection.yaml index 9e719702193..8646d84474a 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection_Type_Refinement_With_Same_Unskipped_Selection.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection_Type_Refinement_With_Same_Unskipped_Selection.yaml @@ -33,12 +33,8 @@ sourceSchemas: query: Query } - interface Authorable { - author: Author - } - - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup } type Author implements Node { @@ -50,8 +46,12 @@ sourceSchemas: author: Author } - type Query { - node(id: ID!): Node @lookup + interface Authorable { + author: Author + } + + interface Node { + id: ID! } interactions: - request: @@ -94,15 +94,15 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! username: String rating: Int } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Type_Refinement.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Type_Refinement.yaml index 47b99b1cc66..cf719e42163 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Type_Refinement.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Type_Refinement.yaml @@ -26,12 +26,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - - interface Votable { - viewerCanVote: Boolean! + type Query { + node(id: ID!): Node @lookup } type Author implements Node & Votable { @@ -45,8 +41,12 @@ sourceSchemas: viewerCanVote: Boolean! } - type Query { - node(id: ID!): Node @lookup + interface Node { + id: ID! + } + + interface Votable { + viewerCanVote: Boolean! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_NodeField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_NodeField.yaml index d23f453de7b..a22a9dd6985 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_NodeField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_NodeField.yaml @@ -22,8 +22,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup } type Discussion implements Node { @@ -31,8 +31,8 @@ sourceSchemas: title: String } - type Query { - node(id: ID!): Node @lookup + interface Node { + id: ID! } operationPlan: operation: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Selection_In_Type_Refinement.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Selection_In_Type_Refinement.yaml index 273839df89b..6637f374d74 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Selection_In_Type_Refinement.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Selection_In_Type_Refinement.yaml @@ -29,8 +29,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup } type Discussion implements Node { @@ -38,8 +38,8 @@ sourceSchemas: title: String } - type Query { - node(id: ID!): Node @lookup + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Shared_Selection.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Shared_Selection.yaml index 8e78ba90570..cc0ab58707b 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Shared_Selection.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Shared_Selection.yaml @@ -29,8 +29,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Discussion implements Node { @@ -38,8 +38,8 @@ sourceSchemas: title: String } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } interactions: - request: @@ -76,8 +76,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Author implements Node { @@ -85,8 +85,8 @@ sourceSchemas: username: String } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } operationPlan: operation: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Type_Refinement.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Type_Refinement.yaml index d55e79eaaad..46a9bd2ca54 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Type_Refinement.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Type_Refinement.yaml @@ -29,8 +29,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup } type Discussion implements Node { @@ -38,8 +38,8 @@ sourceSchemas: title: String } - type Query { - node(id: ID!): Node @lookup + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Field_Statically_Skipped.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Field_Statically_Skipped.yaml index 2af662c00fd..e5d1edc2d54 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Field_Statically_Skipped.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Field_Statically_Skipped.yaml @@ -18,14 +18,14 @@ sourceSchemas: query: Query } + type Query { + productBySlug(slug: String!): Product + } + type Product { id: ID! name: String! } - - type Query { - productBySlug(slug: String!): Product - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Multiple_Skip_Levels_Around_Fields_From_Different_Source_Schemas.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Multiple_Skip_Levels_Around_Fields_From_Different_Source_Schemas.yaml index 916b3a346e1..9bbb558bb2e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Multiple_Skip_Levels_Around_Fields_From_Different_Source_Schemas.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Multiple_Skip_Levels_Around_Fields_From_Different_Source_Schemas.yaml @@ -30,14 +30,14 @@ sourceSchemas: query: Query } + type Query { + productBySlug(slug: String!): Product + } + type Product { id: ID! name: String! } - - type Query { - productBySlug(slug: String!): Product - } - name: B schema: | schema { diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_From_Different_Source_Schemas.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_From_Different_Source_Schemas.yaml index 602ca179062..0966d90f9a9 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_From_Different_Source_Schemas.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_From_Different_Source_Schemas.yaml @@ -27,14 +27,14 @@ sourceSchemas: query: Query } + type Query { + productBySlug(slug: String!): Product + } + type Product { id: ID! name: String! } - - type Query { - productBySlug(slug: String!): Product - } - name: B schema: | schema { diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_Of_Same_Source_Schema.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_Of_Same_Source_Schema.yaml index c6f14d61578..d547a1253fc 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_Of_Same_Source_Schema.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_Of_Same_Source_Schema.yaml @@ -27,16 +27,16 @@ sourceSchemas: query: Query } - type Product { - id: ID! - name: String! - } - type Query { productBySlug(slug: String!): Product viewer: Viewer } + type Product { + id: ID! + name: String! + } + type Viewer { name: String! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_On_Field.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_On_Field.yaml index b40ee1ad8a3..0be2e44cd9b 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_On_Field.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_On_Field.yaml @@ -22,14 +22,14 @@ sourceSchemas: query: Query } + type Query { + productBySlug(slug: String!): Product + } + type Product { id: ID! name: String! } - - type Query { - productBySlug(slug: String!): Product - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_From_Different_Source_Schemas.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_From_Different_Source_Schemas.yaml index 81d8b6ff945..e87e402d22f 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_From_Different_Source_Schemas.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_From_Different_Source_Schemas.yaml @@ -29,14 +29,14 @@ sourceSchemas: query: Query } + type Query { + productBySlug(slug: String!): Product + } + type Product { id: ID! name: String! } - - type Query { - productBySlug(slug: String!): Product - } - name: B schema: | schema { diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_Of_Same_Source_Schema.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_Of_Same_Source_Schema.yaml index bc0df1bdb93..e5bb749968c 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_Of_Same_Source_Schema.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_Of_Same_Source_Schema.yaml @@ -29,16 +29,16 @@ sourceSchemas: query: Query } - type Product { - id: ID! - name: String! - } - type Query { productBySlug(slug: String!): Product viewer: Viewer } + type Product { + id: ID! + name: String! + } + type Viewer { name: String! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_List_Of_Files.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_List_Of_Files.yaml index df31e12c1f6..412757c7677 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_List_Of_Files.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_List_Of_Files.yaml @@ -48,12 +48,6 @@ sourceSchemas: query: Query } - type FileUploadResult { - fileName: String! - contentType: String - content: String! - } - type Query { singleUpload(file: Upload!): FileUploadResult! nullableUpload(file: Upload): FileUploadResult @@ -62,6 +56,12 @@ sourceSchemas: multiUploadWithInput(input: FilesInput!): [FileUploadResult!]! } + type FileUploadResult { + fileName: String! + contentType: String + content: String! + } + input FileInput { file: Upload! } @@ -86,15 +86,15 @@ sourceSchemas: LIST } + "The `Upload` scalar type represents a file upload." + scalar Upload @serializeAs(type: STRING) + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `Upload` scalar type represents a file upload." - scalar Upload @serializeAs(type: STRING) interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_List_Of_Files_In_Input_Object.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_List_Of_Files_In_Input_Object.yaml index b793343ad84..2c5523753fd 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_List_Of_Files_In_Input_Object.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_List_Of_Files_In_Input_Object.yaml @@ -48,12 +48,6 @@ sourceSchemas: query: Query } - type FileUploadResult { - fileName: String! - contentType: String - content: String! - } - type Query { singleUpload(file: Upload!): FileUploadResult! nullableUpload(file: Upload): FileUploadResult @@ -62,6 +56,12 @@ sourceSchemas: multiUploadWithInput(input: FilesInput!): [FileUploadResult!]! } + type FileUploadResult { + fileName: String! + contentType: String + content: String! + } + input FileInput { file: Upload! } @@ -86,15 +86,15 @@ sourceSchemas: LIST } + "The `Upload` scalar type represents a file upload." + scalar Upload @serializeAs(type: STRING) + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `Upload` scalar type represents a file upload." - scalar Upload @serializeAs(type: STRING) interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_List_Of_Files_In_Input_Object_Inline.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_List_Of_Files_In_Input_Object_Inline.yaml index edde7d5cafb..cf7b56c1644 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_List_Of_Files_In_Input_Object_Inline.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_List_Of_Files_In_Input_Object_Inline.yaml @@ -48,12 +48,6 @@ sourceSchemas: query: Query } - type FileUploadResult { - fileName: String! - contentType: String - content: String! - } - type Query { singleUpload(file: Upload!): FileUploadResult! nullableUpload(file: Upload): FileUploadResult @@ -62,6 +56,12 @@ sourceSchemas: multiUploadWithInput(input: FilesInput!): [FileUploadResult!]! } + type FileUploadResult { + fileName: String! + contentType: String + content: String! + } + input FileInput { file: Upload! } @@ -86,15 +86,15 @@ sourceSchemas: LIST } + "The `Upload` scalar type represents a file upload." + scalar Upload @serializeAs(type: STRING) + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `Upload` scalar type represents a file upload." - scalar Upload @serializeAs(type: STRING) interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Nullable_File.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Nullable_File.yaml index 7bc3e98e668..44386bc0201 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Nullable_File.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Nullable_File.yaml @@ -36,12 +36,6 @@ sourceSchemas: query: Query } - type FileUploadResult { - fileName: String! - contentType: String - content: String! - } - type Query { singleUpload(file: Upload!): FileUploadResult! nullableUpload(file: Upload): FileUploadResult @@ -50,6 +44,12 @@ sourceSchemas: multiUploadWithInput(input: FilesInput!): [FileUploadResult!]! } + type FileUploadResult { + fileName: String! + contentType: String + content: String! + } + input FileInput { file: Upload! } @@ -74,15 +74,15 @@ sourceSchemas: LIST } + "The `Upload` scalar type represents a file upload." + scalar Upload @serializeAs(type: STRING) + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `Upload` scalar type represents a file upload." - scalar Upload @serializeAs(type: STRING) interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Nullable_File_Not_Provided.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Nullable_File_Not_Provided.yaml index 48706059cbd..996ec901007 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Nullable_File_Not_Provided.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Nullable_File_Not_Provided.yaml @@ -26,12 +26,6 @@ sourceSchemas: query: Query } - type FileUploadResult { - fileName: String! - contentType: String - content: String! - } - type Query { singleUpload(file: Upload!): FileUploadResult! nullableUpload(file: Upload): FileUploadResult @@ -40,6 +34,12 @@ sourceSchemas: multiUploadWithInput(input: FilesInput!): [FileUploadResult!]! } + type FileUploadResult { + fileName: String! + contentType: String + content: String! + } + input FileInput { file: Upload! } @@ -64,15 +64,15 @@ sourceSchemas: LIST } + "The `Upload` scalar type represents a file upload." + scalar Upload @serializeAs(type: STRING) + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `Upload` scalar type represents a file upload." - scalar Upload @serializeAs(type: STRING) interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Single_File.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Single_File.yaml index 7ee04942441..ddab11b51cb 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Single_File.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Single_File.yaml @@ -36,12 +36,6 @@ sourceSchemas: query: Query } - type FileUploadResult { - fileName: String! - contentType: String - content: String! - } - type Query { singleUpload(file: Upload!): FileUploadResult! nullableUpload(file: Upload): FileUploadResult @@ -50,6 +44,12 @@ sourceSchemas: multiUploadWithInput(input: FilesInput!): [FileUploadResult!]! } + type FileUploadResult { + fileName: String! + contentType: String + content: String! + } + input FileInput { file: Upload! } @@ -74,15 +74,15 @@ sourceSchemas: LIST } + "The `Upload` scalar type represents a file upload." + scalar Upload @serializeAs(type: STRING) + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `Upload` scalar type represents a file upload." - scalar Upload @serializeAs(type: STRING) interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Single_File_In_Input_Object.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Single_File_In_Input_Object.yaml index 1580b62dc78..da5ed33d8a5 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Single_File_In_Input_Object.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Single_File_In_Input_Object.yaml @@ -36,12 +36,6 @@ sourceSchemas: query: Query } - type FileUploadResult { - fileName: String! - contentType: String - content: String! - } - type Query { singleUpload(file: Upload!): FileUploadResult! nullableUpload(file: Upload): FileUploadResult @@ -50,6 +44,12 @@ sourceSchemas: multiUploadWithInput(input: FilesInput!): [FileUploadResult!]! } + type FileUploadResult { + fileName: String! + contentType: String + content: String! + } + input FileInput { file: Upload! } @@ -74,15 +74,15 @@ sourceSchemas: LIST } + "The `Upload` scalar type represents a file upload." + scalar Upload @serializeAs(type: STRING) + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `Upload` scalar type represents a file upload." - scalar Upload @serializeAs(type: STRING) interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Single_File_In_Input_Object_Inline.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Single_File_In_Input_Object_Inline.yaml index 38d9b654d29..9e81fbd0620 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Single_File_In_Input_Object_Inline.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/FileUploadTests.Upload_Single_File_In_Input_Object_Inline.yaml @@ -36,12 +36,6 @@ sourceSchemas: query: Query } - type FileUploadResult { - fileName: String! - contentType: String - content: String! - } - type Query { singleUpload(file: Upload!): FileUploadResult! nullableUpload(file: Upload): FileUploadResult @@ -50,6 +44,12 @@ sourceSchemas: multiUploadWithInput(input: FilesInput!): [FileUploadResult!]! } + type FileUploadResult { + fileName: String! + contentType: String + content: String! + } + input FileInput { file: Upload! } @@ -74,15 +74,15 @@ sourceSchemas: LIST } + "The `Upload` scalar type represents a file upload." + scalar Upload @serializeAs(type: STRING) + directive @serializeAs( "The primitive type a scalar is serialized to." type: [ScalarSerializationType!]! "The ECMA-262 regex pattern that the serialized scalar value conforms to." pattern: String ) on SCALAR - - "The `Upload` scalar type represents a file upload." - scalar Upload @serializeAs(type: STRING) interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested.yaml index 999c1e48956..076a291b9bb 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested.yaml @@ -26,8 +26,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } type Discussion implements Node { @@ -35,9 +36,8 @@ sourceSchemas: title: String! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup + interface Node { + id: ID! } interactions: - request: @@ -68,8 +68,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(id: ID!): Discussion @lookup @internal } type Discussion implements Node { @@ -82,9 +83,8 @@ sourceSchemas: name: String! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(id: ID!): Discussion @lookup @internal + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested_Abstract_Lookup.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested_Abstract_Lookup.yaml index 98ee8d62728..50ee9444af7 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested_Abstract_Lookup.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested_Abstract_Lookup.yaml @@ -26,8 +26,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } type Discussion implements Node { @@ -35,9 +36,8 @@ sourceSchemas: title: String! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup + interface Node { + id: ID! } - name: B schema: | @@ -45,8 +45,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(id: ID!): Discussion @lookup @internal } type Discussion implements Node { @@ -59,9 +60,8 @@ sourceSchemas: name: String! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(id: ID!): Discussion @lookup @internal + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Type_Different_From_Concrete_Type_Selections_Requested.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Type_Different_From_Concrete_Type_Selections_Requested.yaml index be36c6ec141..e65e071d55c 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Type_Different_From_Concrete_Type_Selections_Requested.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Type_Different_From_Concrete_Type_Selections_Requested.yaml @@ -25,8 +25,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } type Discussion implements Node { @@ -34,9 +35,8 @@ sourceSchemas: title: String! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup + interface Node { + id: ID! } - name: B schema: | @@ -44,8 +44,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(id: ID!): Discussion @lookup @internal } type Discussion implements Node { @@ -58,9 +59,8 @@ sourceSchemas: name: String! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(id: ID!): Discussion @lookup @internal + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Unknown_Type_Requested.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Unknown_Type_Requested.yaml index 9b029c4ceff..e35e9c3f5e2 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Unknown_Type_Requested.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Unknown_Type_Requested.yaml @@ -33,8 +33,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } type Discussion implements Node { @@ -42,9 +43,8 @@ sourceSchemas: title: String! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup + interface Node { + id: ID! } - name: B schema: | @@ -52,8 +52,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(id: ID!): Discussion @lookup @internal } type Discussion implements Node { @@ -66,9 +67,8 @@ sourceSchemas: name: String! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(id: ID!): Discussion @lookup @internal + interface Node { + id: ID! } operationPlan: operation: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Invalid_Id_Requested.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Invalid_Id_Requested.yaml index b8d68b1c9f8..a582044016b 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Invalid_Id_Requested.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Invalid_Id_Requested.yaml @@ -33,8 +33,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } type Discussion implements Node { @@ -42,9 +43,8 @@ sourceSchemas: title: String! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup + interface Node { + id: ID! } - name: B schema: | @@ -52,8 +52,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(id: ID!): Discussion @lookup @internal } type Discussion implements Node { @@ -66,9 +67,8 @@ sourceSchemas: name: String! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(id: ID!): Discussion @lookup @internal + interface Node { + id: ID! } operationPlan: operation: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Alongside_Regular_Root_Selections.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Alongside_Regular_Root_Selections.yaml index 13f2821eb17..8c71e8d186c 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Alongside_Regular_Root_Selections.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Alongside_Regular_Root_Selections.yaml @@ -36,8 +36,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup + viewer: Viewer } type Discussion implements Node { @@ -45,14 +46,13 @@ sourceSchemas: title: String! } - type Query { - node(id: ID!): Node @lookup - viewer: Viewer - } - type Viewer { username: String } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Has_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Has_Dependency.yaml index 28666ef5863..e12411b0a04 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Has_Dependency.yaml @@ -30,8 +30,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup } type Discussion implements Node { @@ -39,8 +39,8 @@ sourceSchemas: name: String } - type Query { - node(id: ID!): Node @lookup + interface Node { + id: ID! } interactions: - request: @@ -78,8 +78,8 @@ sourceSchemas: query: Query } - interface Node @key(fields: "id") { - id: ID! + type Query { + discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } type Discussion implements Node { @@ -87,8 +87,8 @@ sourceSchemas: commentCount: Int } - type Query { - discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup + interface Node @key(fields: "id") { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Selection_Has_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Selection_Has_Dependency.yaml index 6ec4416e143..5561d70fb72 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Selection_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Selection_Has_Dependency.yaml @@ -36,8 +36,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(id: ID!): Discussion @lookup } type Discussion implements Node { @@ -50,9 +51,8 @@ sourceSchemas: id: ID! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(id: ID!): Discussion @lookup + interface Node { + id: ID! } interactions: - request: @@ -93,8 +93,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Product implements Node { @@ -102,8 +102,8 @@ sourceSchemas: name: String } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface.yaml index f0114bbcf0a..dba28a227bd 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface.yaml @@ -28,12 +28,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - - interface Votable { - viewerCanVote: Boolean! + type Query { + node(id: ID!): Node @lookup } type Comment implements Node & Votable { @@ -47,8 +43,12 @@ sourceSchemas: viewerRating: Float! } - type Query { - node(id: ID!): Node @lookup + interface Node { + id: ID! + } + + interface Votable { + viewerCanVote: Boolean! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type.yaml index c005038daa3..d74a54402b9 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type.yaml @@ -32,12 +32,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - - interface Votable { - viewerCanVote: Boolean! + type Query { + node(id: ID!): Node @lookup } type Comment implements Node & Votable { @@ -51,8 +47,12 @@ sourceSchemas: viewerRating: Float! } - type Query { - node(id: ID!): Node @lookup + interface Node { + id: ID! + } + + interface Votable { + viewerCanVote: Boolean! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type_Both_Have_Different_Dependencies.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type_Both_Have_Different_Dependencies.yaml index 798e1679b8c..9a3195cf55b 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type_Both_Have_Different_Dependencies.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type_Both_Have_Different_Dependencies.yaml @@ -56,12 +56,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - - interface ProductList { - products: [Product] + type Query { + node(id: ID!): Node @lookup @shareable } type Item1 implements Node & ProductList { @@ -79,8 +75,12 @@ sourceSchemas: id: ID! } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! + } + + interface ProductList { + products: [Product] } interactions: - request: @@ -136,8 +136,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Product implements Node { @@ -145,8 +145,8 @@ sourceSchemas: name: String } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type_Both_Have_Same_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type_Both_Have_Same_Dependency.yaml index f114b09b7d7..a1d9c15a508 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type_Both_Have_Same_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type_Both_Have_Same_Dependency.yaml @@ -42,12 +42,8 @@ sourceSchemas: query: Query } - interface Authorable { - author: Author - } - - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup } type Author implements Node { @@ -60,8 +56,12 @@ sourceSchemas: title: String } - type Query { - node(id: ID!): Node @lookup + interface Authorable { + author: Author + } + + interface Node { + id: ID! } interactions: - request: @@ -106,15 +106,15 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! username: String rating: Int } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_Selection_Has_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_Selection_Has_Dependency.yaml index 409a45ae4cc..a7783225011 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_Selection_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_Selection_Has_Dependency.yaml @@ -44,12 +44,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - - interface ProductList { - products: [Product] + type Query { + node(id: ID!): Node @lookup @shareable } type Item1 implements Node & ProductList { @@ -66,8 +62,12 @@ sourceSchemas: id: ID! } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! + } + + interface ProductList { + products: [Product] } interactions: - request: @@ -117,8 +117,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Product implements Node { @@ -126,8 +126,8 @@ sourceSchemas: name: String } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Different_Dependencies.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Different_Dependencies.yaml index 7678de4f6c3..e99d8754cb2 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Different_Dependencies.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Different_Dependencies.yaml @@ -39,8 +39,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Discussion implements Node { @@ -52,8 +52,8 @@ sourceSchemas: id: ID! } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } interactions: - request: @@ -93,30 +93,30 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Product @key(fields: "id") { id: ID! } - type Query { - node(id: ID!): Node @lookup @shareable - } - type Review implements Node { id: ID! product: Product } + + interface Node { + id: ID! + } - name: C schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Product implements Node { @@ -124,8 +124,8 @@ sourceSchemas: name: String } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Same_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Same_Dependency.yaml index 29ba60721ef..dd962dbacd7 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Same_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Same_Dependency.yaml @@ -37,8 +37,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Discussion implements Node { @@ -50,8 +50,8 @@ sourceSchemas: id: ID! } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } interactions: - request: @@ -91,30 +91,30 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Product @key(fields: "id") { id: ID! } - type Query { - node(id: ID!): Node @lookup @shareable - } - type Review implements Node { id: ID! product: Product } + + interface Node { + id: ID! + } - name: C schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Product implements Node { @@ -122,8 +122,8 @@ sourceSchemas: name: String } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_Id_And_Typename_Selected.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_Id_And_Typename_Selected.yaml index 6d79fab72c0..843a09f205e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_Id_And_Typename_Selected.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_Id_And_Typename_Selected.yaml @@ -24,8 +24,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup } type Discussion implements Node { @@ -33,8 +33,8 @@ sourceSchemas: title: String! } - type Query { - node(id: ID!): Node @lookup + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_TypeName_Selected_On_Concrete_Type.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_TypeName_Selected_On_Concrete_Type.yaml index 1c5833ecc2a..9f45df24b35 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_TypeName_Selected_On_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_TypeName_Selected_On_Concrete_Type.yaml @@ -24,8 +24,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } type Discussion implements Node { @@ -33,9 +34,8 @@ sourceSchemas: title: String! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup + interface Node { + id: ID! } interactions: - request: @@ -62,8 +62,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(id: ID!): Discussion @lookup @internal } type Discussion implements Node { @@ -71,9 +72,8 @@ sourceSchemas: commentCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(id: ID!): Discussion @lookup @internal + interface Node { + id: ID! } operationPlan: operation: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_Typename_Selected.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_Typename_Selected.yaml index 6640b3930f9..5cb78e741e5 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_Typename_Selected.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_Typename_Selected.yaml @@ -26,8 +26,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable } type Discussion implements Node { @@ -35,8 +35,8 @@ sourceSchemas: title: String! } - type Query { - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } interactions: - request: @@ -67,8 +67,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + authorById(id: ID!): Author @lookup + node(id: ID!): Node @lookup @shareable } type Author implements Node { @@ -76,9 +77,8 @@ sourceSchemas: username: String! } - type Query { - authorById(id: ID!): Author @lookup - node(id: ID!): Node @lookup @shareable + interface Node { + id: ID! } operationPlan: operation: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Two_Node_Fields_With_Alias.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Two_Node_Fields_With_Alias.yaml index d23df7c31ba..42e0746ab94 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Two_Node_Fields_With_Alias.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Two_Node_Fields_With_Alias.yaml @@ -34,8 +34,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } type Discussion implements Node { @@ -43,9 +44,8 @@ sourceSchemas: title: String! } - type Query { - node(id: ID!): Node @lookup @shareable - discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup + interface Node { + id: ID! } interactions: - request: @@ -96,8 +96,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + discussion(id: ID!): Discussion @lookup } type Discussion implements Node { @@ -105,9 +106,8 @@ sourceSchemas: commentCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - discussion(id: ID!): Discussion @lookup + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Enum_With_Inaccessible_Value_When_Accessible_Value_Is_Used.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Enum_With_Inaccessible_Value_When_Accessible_Value_Is_Used.yaml index 198f49e98c9..e44e9a83663 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Enum_With_Inaccessible_Value_When_Accessible_Value_Is_Used.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Enum_With_Inaccessible_Value_When_Accessible_Value_Is_Used.yaml @@ -18,6 +18,12 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + inaccessibleText(text: String! = "This is the default!" @inaccessible): String! + books: [Book!]! + } + type Author @key(fields: "id") { id: Int! @inaccessible } @@ -27,29 +33,23 @@ sourceSchemas: title: String! author: Author! } - - type Query { - bookById(id: Int!): Book @lookup - inaccessibleText(text: String! = "This is the default!" @inaccessible): String! - books: [Book!]! - } - name: b schema: | schema { query: Query } - type Author { - id: Int! - name: String! - } - type Query { authorById(id: Int!): Author @internal @lookup enumField(value: SomeEnum!): SomeEnum! shareable(input: SomeInput!): String! } + type Author { + id: Int! + name: String! + } + input SomeInput { a: String! b: String = "ABC" @inaccessible diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Enum_With_Inaccessible_Value_When_Inaccessible_Value_Is_Used.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Enum_With_Inaccessible_Value_When_Inaccessible_Value_Is_Used.yaml index a668b16174e..cd8dca4f1af 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Enum_With_Inaccessible_Value_When_Inaccessible_Value_Is_Used.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Enum_With_Inaccessible_Value_When_Inaccessible_Value_Is_Used.yaml @@ -35,6 +35,12 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + inaccessibleText(text: String! = "This is the default!" @inaccessible): String! + books: [Book!]! + } + type Author @key(fields: "id") { id: Int! @inaccessible } @@ -44,29 +50,23 @@ sourceSchemas: title: String! author: Author! } - - type Query { - bookById(id: Int!): Book @lookup - inaccessibleText(text: String! = "This is the default!" @inaccessible): String! - books: [Book!]! - } - name: b schema: | schema { query: Query } - type Author { - id: Int! - name: String! - } - type Query { authorById(id: Int!): Author @internal @lookup enumField(value: SomeEnum!): SomeEnum! shareable(input: SomeInput!): String! } + type Author { + id: Int! + name: String! + } + input SomeInput { a: String! b: String = "ABC" @inaccessible diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Field_With_Inaccessible_Argument_Can_Be_Queried.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Field_With_Inaccessible_Argument_Can_Be_Queried.yaml index 748e4ed185a..9b2d86657b1 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Field_With_Inaccessible_Argument_Can_Be_Queried.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Field_With_Inaccessible_Argument_Can_Be_Queried.yaml @@ -18,6 +18,12 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + inaccessibleText(text: String! = "This is the default!" @inaccessible): String! + books: [Book!]! + } + type Author @key(fields: "id") { id: Int! @inaccessible } @@ -27,12 +33,6 @@ sourceSchemas: title: String! author: Author! } - - type Query { - bookById(id: Int!): Book @lookup - inaccessibleText(text: String! = "This is the default!" @inaccessible): String! - books: [Book!]! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -54,17 +54,17 @@ sourceSchemas: query: Query } - type Author { - id: Int! - name: String! - } - type Query { authorById(id: Int!): Author @internal @lookup enumField(value: SomeEnum!): SomeEnum! shareable(input: SomeInput!): String! } + type Author { + id: Int! + name: String! + } + input SomeInput { a: String! b: String = "ABC" @inaccessible diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Field_With_Inaccessible_Argument_Cannot_Be_Passed_In.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Field_With_Inaccessible_Argument_Cannot_Be_Passed_In.yaml index e6386bbabe4..6a5fbe228c1 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Field_With_Inaccessible_Argument_Cannot_Be_Passed_In.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Field_With_Inaccessible_Argument_Cannot_Be_Passed_In.yaml @@ -32,6 +32,12 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + inaccessibleText(text: String! = "This is the default!" @inaccessible): String! + books: [Book!]! + } + type Author @key(fields: "id") { id: Int! @inaccessible } @@ -41,29 +47,23 @@ sourceSchemas: title: String! author: Author! } - - type Query { - bookById(id: Int!): Book @lookup - inaccessibleText(text: String! = "This is the default!" @inaccessible): String! - books: [Book!]! - } - name: b schema: | schema { query: Query } - type Author { - id: Int! - name: String! - } - type Query { authorById(id: Int!): Author @internal @lookup enumField(value: SomeEnum!): SomeEnum! shareable(input: SomeInput!): String! } + type Author { + id: Int! + name: String! + } + input SomeInput { a: String! b: String = "ABC" @inaccessible diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Argument_Not_In_Field_Introspection.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Argument_Not_In_Field_Introspection.yaml index 5f80011de1e..8c7cd9236cf 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Argument_Not_In_Field_Introspection.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Argument_Not_In_Field_Introspection.yaml @@ -60,6 +60,12 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + inaccessibleText(text: String! = "This is the default!" @inaccessible): String! + books: [Book!]! + } + type Author @key(fields: "id") { id: Int! @inaccessible } @@ -69,29 +75,23 @@ sourceSchemas: title: String! author: Author! } - - type Query { - bookById(id: Int!): Book @lookup - inaccessibleText(text: String! = "This is the default!" @inaccessible): String! - books: [Book!]! - } - name: b schema: | schema { query: Query } - type Author { - id: Int! - name: String! - } - type Query { authorById(id: Int!): Author @internal @lookup enumField(value: SomeEnum!): SomeEnum! shareable(input: SomeInput!): String! } + type Author { + id: Int! + name: String! + } + input SomeInput { a: String! b: String = "ABC" @inaccessible diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Enum_Type_Cannot_Be_Queried_Via_Introspection.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Enum_Type_Cannot_Be_Queried_Via_Introspection.yaml index 95fd73e58a3..118339c2410 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Enum_Type_Cannot_Be_Queried_Via_Introspection.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Enum_Type_Cannot_Be_Queried_Via_Introspection.yaml @@ -21,17 +21,17 @@ sourceSchemas: query: Query } - type InternalMetadata @inaccessible { - version: String! - buildNumber: String! - } - type Query { metadata: InternalMetadata! @inaccessible statusField(status: InternalStatus! = ACTIVE @inaccessible): String! filterData(filter: InternalFilterInput @inaccessible): String! } + type InternalMetadata @inaccessible { + version: String! + buildNumber: String! + } + input InternalFilterInput @inaccessible { includeInternal: Boolean! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Enum_Type_Cannot_Be_Used.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Enum_Type_Cannot_Be_Used.yaml index 6752a29f943..38725ae43a0 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Enum_Type_Cannot_Be_Used.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Enum_Type_Cannot_Be_Used.yaml @@ -32,17 +32,17 @@ sourceSchemas: query: Query } - type InternalMetadata @inaccessible { - version: String! - buildNumber: String! - } - type Query { metadata: InternalMetadata! @inaccessible statusField(status: InternalStatus! = ACTIVE @inaccessible): String! filterData(filter: InternalFilterInput @inaccessible): String! } + type InternalMetadata @inaccessible { + version: String! + buildNumber: String! + } + input InternalFilterInput @inaccessible { includeInternal: Boolean! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Enum_Value_Not_In_Enum_Introspection.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Enum_Value_Not_In_Enum_Introspection.yaml index bb76db196d4..81b64ff34ec 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Enum_Value_Not_In_Enum_Introspection.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Enum_Value_Not_In_Enum_Introspection.yaml @@ -28,6 +28,12 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + inaccessibleText(text: String! = "This is the default!" @inaccessible): String! + books: [Book!]! + } + type Author @key(fields: "id") { id: Int! @inaccessible } @@ -37,29 +43,23 @@ sourceSchemas: title: String! author: Author! } - - type Query { - bookById(id: Int!): Book @lookup - inaccessibleText(text: String! = "This is the default!" @inaccessible): String! - books: [Book!]! - } - name: b schema: | schema { query: Query } - type Author { - id: Int! - name: String! - } - type Query { authorById(id: Int!): Author @internal @lookup enumField(value: SomeEnum!): SomeEnum! shareable(input: SomeInput!): String! } + type Author { + id: Int! + name: String! + } + input SomeInput { a: String! b: String = "ABC" @inaccessible diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Fields_Can_Be_Used_As_Requirements.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Fields_Can_Be_Used_As_Requirements.yaml index 04be273c75e..79b0e4a0343 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Fields_Can_Be_Used_As_Requirements.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Fields_Can_Be_Used_As_Requirements.yaml @@ -26,6 +26,12 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + inaccessibleText(text: String! = "This is the default!" @inaccessible): String! + books: [Book!]! + } + type Author @key(fields: "id") { id: Int! @inaccessible } @@ -35,12 +41,6 @@ sourceSchemas: title: String! author: Author! } - - type Query { - bookById(id: Int!): Book @lookup - inaccessibleText(text: String! = "This is the default!" @inaccessible): String! - books: [Book!]! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -70,17 +70,17 @@ sourceSchemas: query: Query } - type Author { - id: Int! - name: String! - } - type Query { authorById(id: Int!): Author @internal @lookup enumField(value: SomeEnum!): SomeEnum! shareable(input: SomeInput!): String! } + type Author { + id: Int! + name: String! + } + input SomeInput { a: String! b: String = "ABC" @inaccessible diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Fields_Cannot_Be_Queried.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Fields_Cannot_Be_Queried.yaml index 7d7759d5c03..02615537a03 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Fields_Cannot_Be_Queried.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Fields_Cannot_Be_Queried.yaml @@ -36,6 +36,12 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + inaccessibleText(text: String! = "This is the default!" @inaccessible): String! + books: [Book!]! + } + type Author @key(fields: "id") { id: Int! @inaccessible } @@ -45,29 +51,23 @@ sourceSchemas: title: String! author: Author! } - - type Query { - bookById(id: Int!): Book @lookup - inaccessibleText(text: String! = "This is the default!" @inaccessible): String! - books: [Book!]! - } - name: b schema: | schema { query: Query } - type Author { - id: Int! - name: String! - } - type Query { authorById(id: Int!): Author @internal @lookup enumField(value: SomeEnum!): SomeEnum! shareable(input: SomeInput!): String! } + type Author { + id: Int! + name: String! + } + input SomeInput { a: String! b: String = "ABC" @inaccessible diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Fields_Cannot_Be_Queried_Via_Introspection.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Fields_Cannot_Be_Queried_Via_Introspection.yaml index 020051df325..435a3b1b7c0 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Fields_Cannot_Be_Queried_Via_Introspection.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Fields_Cannot_Be_Queried_Via_Introspection.yaml @@ -28,6 +28,12 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + inaccessibleText(text: String! = "This is the default!" @inaccessible): String! + books: [Book!]! + } + type Author @key(fields: "id") { id: Int! @inaccessible } @@ -37,29 +43,23 @@ sourceSchemas: title: String! author: Author! } - - type Query { - bookById(id: Int!): Book @lookup - inaccessibleText(text: String! = "This is the default!" @inaccessible): String! - books: [Book!]! - } - name: b schema: | schema { query: Query } - type Author { - id: Int! - name: String! - } - type Query { authorById(id: Int!): Author @internal @lookup enumField(value: SomeEnum!): SomeEnum! shareable(input: SomeInput!): String! } + type Author { + id: Int! + name: String! + } + input SomeInput { a: String! b: String = "ABC" @inaccessible diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Input_Field_Not_In_Input_Object_Introspection.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Input_Field_Not_In_Input_Object_Introspection.yaml index 03c1ffed14e..f9ee8f2e877 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Input_Field_Not_In_Input_Object_Introspection.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Input_Field_Not_In_Input_Object_Introspection.yaml @@ -28,6 +28,12 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + inaccessibleText(text: String! = "This is the default!" @inaccessible): String! + books: [Book!]! + } + type Author @key(fields: "id") { id: Int! @inaccessible } @@ -37,29 +43,23 @@ sourceSchemas: title: String! author: Author! } - - type Query { - bookById(id: Int!): Book @lookup - inaccessibleText(text: String! = "This is the default!" @inaccessible): String! - books: [Book!]! - } - name: b schema: | schema { query: Query } - type Author { - id: Int! - name: String! - } - type Query { authorById(id: Int!): Author @internal @lookup enumField(value: SomeEnum!): SomeEnum! shareable(input: SomeInput!): String! } + type Author { + id: Int! + name: String! + } + input SomeInput { a: String! b: String = "ABC" @inaccessible diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Input_Object_Type_Cannot_Be_Queried_Via_Introspection.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Input_Object_Type_Cannot_Be_Queried_Via_Introspection.yaml index 24f141922a0..63e92b5b609 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Input_Object_Type_Cannot_Be_Queried_Via_Introspection.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Input_Object_Type_Cannot_Be_Queried_Via_Introspection.yaml @@ -21,17 +21,17 @@ sourceSchemas: query: Query } - type InternalMetadata @inaccessible { - version: String! - buildNumber: String! - } - type Query { metadata: InternalMetadata! @inaccessible statusField(status: InternalStatus! = ACTIVE @inaccessible): String! filterData(filter: InternalFilterInput @inaccessible): String! } + type InternalMetadata @inaccessible { + version: String! + buildNumber: String! + } + input InternalFilterInput @inaccessible { includeInternal: Boolean! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Input_Object_Type_Cannot_Be_Used.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Input_Object_Type_Cannot_Be_Used.yaml index 5d566aac1bc..6af2d709014 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Input_Object_Type_Cannot_Be_Used.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Input_Object_Type_Cannot_Be_Used.yaml @@ -32,17 +32,17 @@ sourceSchemas: query: Query } - type InternalMetadata @inaccessible { - version: String! - buildNumber: String! - } - type Query { metadata: InternalMetadata! @inaccessible statusField(status: InternalStatus! = ACTIVE @inaccessible): String! filterData(filter: InternalFilterInput @inaccessible): String! } + type InternalMetadata @inaccessible { + version: String! + buildNumber: String! + } + input InternalFilterInput @inaccessible { includeInternal: Boolean! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Object_Type_Cannot_Be_Queried.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Object_Type_Cannot_Be_Queried.yaml index aab0ac0f83e..cc89ad36924 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Object_Type_Cannot_Be_Queried.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Object_Type_Cannot_Be_Queried.yaml @@ -34,17 +34,17 @@ sourceSchemas: query: Query } - type InternalMetadata @inaccessible { - version: String! - buildNumber: String! - } - type Query { metadata: InternalMetadata! @inaccessible statusField(status: InternalStatus! = ACTIVE @inaccessible): String! filterData(filter: InternalFilterInput @inaccessible): String! } + type InternalMetadata @inaccessible { + version: String! + buildNumber: String! + } + input InternalFilterInput @inaccessible { includeInternal: Boolean! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Object_Type_Cannot_Be_Queried_Via_Introspection.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Object_Type_Cannot_Be_Queried_Via_Introspection.yaml index 1ad044a5aaf..876ac9dd073 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Object_Type_Cannot_Be_Queried_Via_Introspection.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Object_Type_Cannot_Be_Queried_Via_Introspection.yaml @@ -21,17 +21,17 @@ sourceSchemas: query: Query } - type InternalMetadata @inaccessible { - version: String! - buildNumber: String! - } - type Query { metadata: InternalMetadata! @inaccessible statusField(status: InternalStatus! = ACTIVE @inaccessible): String! filterData(filter: InternalFilterInput @inaccessible): String! } + type InternalMetadata @inaccessible { + version: String! + buildNumber: String! + } + input InternalFilterInput @inaccessible { includeInternal: Boolean! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Scalar_Type_Cannot_Be_Queried_Via_Introspection.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Scalar_Type_Cannot_Be_Queried_Via_Introspection.yaml index b54cae3a15c..041b916de41 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Scalar_Type_Cannot_Be_Queried_Via_Introspection.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Inaccessible_Scalar_Type_Cannot_Be_Queried_Via_Introspection.yaml @@ -21,17 +21,17 @@ sourceSchemas: query: Query } - type InternalMetadata @inaccessible { - version: String! - buildNumber: String! - } - type Query { metadata: InternalMetadata! @inaccessible statusField(status: InternalStatus! = ACTIVE @inaccessible): String! filterData(filter: InternalFilterInput @inaccessible): String! } + type InternalMetadata @inaccessible { + version: String! + buildNumber: String! + } + input InternalFilterInput @inaccessible { includeInternal: Boolean! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Input_With_Inaccessible_Field_When_Accessible_Field_Is_Passed.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Input_With_Inaccessible_Field_When_Accessible_Field_Is_Passed.yaml index 354a3220d7b..2ccfee2f163 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Input_With_Inaccessible_Field_When_Accessible_Field_Is_Passed.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Input_With_Inaccessible_Field_When_Accessible_Field_Is_Passed.yaml @@ -18,6 +18,12 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + inaccessibleText(text: String! = "This is the default!" @inaccessible): String! + books: [Book!]! + } + type Author @key(fields: "id") { id: Int! @inaccessible } @@ -27,29 +33,23 @@ sourceSchemas: title: String! author: Author! } - - type Query { - bookById(id: Int!): Book @lookup - inaccessibleText(text: String! = "This is the default!" @inaccessible): String! - books: [Book!]! - } - name: b schema: | schema { query: Query } - type Author { - id: Int! - name: String! - } - type Query { authorById(id: Int!): Author @internal @lookup enumField(value: SomeEnum!): SomeEnum! shareable(input: SomeInput!): String! } + type Author { + id: Int! + name: String! + } + input SomeInput { a: String! b: String = "ABC" @inaccessible diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Input_With_Inaccessible_Field_When_Inaccessible_Field_Is_Not_Passed.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Input_With_Inaccessible_Field_When_Inaccessible_Field_Is_Not_Passed.yaml index a7e5e56bd64..f973f282aed 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Input_With_Inaccessible_Field_When_Inaccessible_Field_Is_Not_Passed.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Input_With_Inaccessible_Field_When_Inaccessible_Field_Is_Not_Passed.yaml @@ -33,6 +33,12 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + inaccessibleText(text: String! = "This is the default!" @inaccessible): String! + books: [Book!]! + } + type Author @key(fields: "id") { id: Int! @inaccessible } @@ -42,29 +48,23 @@ sourceSchemas: title: String! author: Author! } - - type Query { - bookById(id: Int!): Book @lookup - inaccessibleText(text: String! = "This is the default!" @inaccessible): String! - books: [Book!]! - } - name: b schema: | schema { query: Query } - type Author { - id: Int! - name: String! - } - type Query { authorById(id: Int!): Author @internal @lookup enumField(value: SomeEnum!): SomeEnum! shareable(input: SomeInput!): String! } + type Author { + id: Int! + name: String! + } + input SomeInput { a: String! b: String = "ABC" @inaccessible diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field.yaml index 7f665708e5f..5a408aa7c33 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field.yaml @@ -22,8 +22,8 @@ sourceSchemas: query: Query } - interface Votable { - viewerCanVote: Boolean! + type Query { + votable: Votable } type Comment implements Votable { @@ -37,8 +37,8 @@ sourceSchemas: viewerRating: Float! } - type Query { - votable: Votable + interface Votable { + viewerCanVote: Boolean! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type.yaml index 1c9037808bd..cd0331254a5 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type.yaml @@ -26,8 +26,8 @@ sourceSchemas: query: Query } - interface Votable { - viewerCanVote: Boolean! + type Query { + votable: Votable } type Comment implements Votable { @@ -41,8 +41,8 @@ sourceSchemas: title: String! } - type Query { - votable: Votable + interface Votable { + viewerCanVote: Boolean! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_Linked_Field_With_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_Linked_Field_With_Dependency.yaml index 815e0744d70..becbcf9cf92 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_Linked_Field_With_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_Linked_Field_With_Dependency.yaml @@ -30,8 +30,8 @@ sourceSchemas: query: Query } - interface Votable { - viewerCanVote: Boolean! + type Query { + votable: Votable } type Author @key(fields: "id") { @@ -49,8 +49,8 @@ sourceSchemas: author: Author } - type Query { - votable: Votable + interface Votable { + viewerCanVote: Boolean! } interactions: - request: @@ -87,14 +87,14 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! displayName: String! } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_With_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_With_Dependency.yaml index 7e002c23584..38968c2e75e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_With_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_With_Dependency.yaml @@ -26,8 +26,9 @@ sourceSchemas: query: Query } - interface Votable { - viewerCanVote: Boolean! + type Query { + votable: Votable + discussionById(id: ID!): Discussion @lookup @shareable } type Comment implements Votable { @@ -40,9 +41,8 @@ sourceSchemas: viewerCanVote: Boolean! } - type Query { - votable: Votable - discussionById(id: ID!): Discussion @lookup @shareable + interface Votable { + viewerCanVote: Boolean! } interactions: - request: @@ -75,14 +75,14 @@ sourceSchemas: query: Query } + type Query { + discussionById(id: ID!): Discussion @lookup @shareable + } + type Discussion { id: ID! viewerRating: Float! } - - type Query { - discussionById(id: ID!): Discussion @lookup @shareable - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency.yaml index 6eeecaecfd4..909426518c2 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency.yaml @@ -28,8 +28,8 @@ sourceSchemas: query: Query } - interface Authorable { - author: Author + type Query { + authorable: Authorable } type Author @key(fields: "id") { @@ -44,8 +44,8 @@ sourceSchemas: author: Author } - type Query { - authorable: Authorable + interface Authorable { + author: Author } interactions: - request: @@ -78,14 +78,14 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! displayName: String! } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml index a1496f6a1f3..991d3eb6c0e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml @@ -34,8 +34,8 @@ sourceSchemas: query: Query } - interface Authorable { - author: Author + type Query { + authorable: Authorable } type Author @key(fields: "id") { @@ -50,8 +50,8 @@ sourceSchemas: author: Author } - type Query { - authorable: Authorable + interface Authorable { + author: Author } interactions: - request: @@ -89,15 +89,15 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! displayName: String! email: String } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml index 7a1e6b6bc0b..a161d45314d 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml @@ -34,8 +34,8 @@ sourceSchemas: query: Query } - interface Authorable { - author: Author + type Query { + authorable: Authorable } type Author @key(fields: "id") { @@ -50,8 +50,8 @@ sourceSchemas: author: Author } - type Query { - authorable: Authorable + interface Authorable { + author: Author } interactions: - request: @@ -89,14 +89,14 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! displayName: String! } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_With_Only_Type_Refinements_Exclusive_To_Other_Schema.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_With_Only_Type_Refinements_Exclusive_To_Other_Schema.yaml index 5c9b324d424..9ae765312da 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_With_Only_Type_Refinements_Exclusive_To_Other_Schema.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_With_Only_Type_Refinements_Exclusive_To_Other_Schema.yaml @@ -22,8 +22,8 @@ sourceSchemas: query: Query } - interface SomeInterface { - value: String + type Query { + someField: SomeInterface } type ConcreteTypeA implements SomeInterface { @@ -31,8 +31,8 @@ sourceSchemas: specificToA: String } - type Query { - someField: SomeInterface + interface SomeInterface { + value: String } interactions: - request: @@ -59,8 +59,8 @@ sourceSchemas: query: Query } - interface SomeInterface { - value: String + type Query { + anotherField: SomeInterface } type ConcreteTypeB implements SomeInterface { @@ -68,8 +68,8 @@ sourceSchemas: specificToB: String } - type Query { - anotherField: SomeInterface + interface SomeInterface { + value: String } operationPlan: operation: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_With_Only_Type_Refinements_On_Same_Schema.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_With_Only_Type_Refinements_On_Same_Schema.yaml index e7e6ea738ca..f03dbbdd7a6 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_With_Only_Type_Refinements_On_Same_Schema.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_With_Only_Type_Refinements_On_Same_Schema.yaml @@ -26,8 +26,8 @@ sourceSchemas: query: Query } - interface SomeInterface { - value: String + type Query { + someField: SomeInterface } type ConcreteTypeA implements SomeInterface { @@ -35,8 +35,8 @@ sourceSchemas: specificToA: String } - type Query { - someField: SomeInterface + interface SomeInterface { + value: String } interactions: - request: @@ -69,8 +69,8 @@ sourceSchemas: query: Query } - interface SomeInterface { - value: String + type Query { + anotherField: SomeInterface } type ConcreteTypeB implements SomeInterface { @@ -78,8 +78,8 @@ sourceSchemas: specificToB: String } - type Query { - anotherField: SomeInterface + interface SomeInterface { + value: String } operationPlan: operation: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_With_Type_Refinements_Exclusive_To_Other_Schema.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_With_Type_Refinements_Exclusive_To_Other_Schema.yaml index 4d1c9562c9c..b552dc6556a 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_With_Type_Refinements_Exclusive_To_Other_Schema.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_With_Type_Refinements_Exclusive_To_Other_Schema.yaml @@ -29,8 +29,8 @@ sourceSchemas: query: Query } - interface SomeInterface { - value: String + type Query { + someField: SomeInterface } type ConcreteTypeA implements SomeInterface { @@ -38,8 +38,8 @@ sourceSchemas: specificToA: String } - type Query { - someField: SomeInterface + interface SomeInterface { + value: String } interactions: - request: @@ -72,8 +72,8 @@ sourceSchemas: query: Query } - interface SomeInterface { - value: String + type Query { + anotherField: SomeInterface } type ConcreteTypeB implements SomeInterface { @@ -81,8 +81,8 @@ sourceSchemas: specificToB: String } - type Query { - anotherField: SomeInterface + interface SomeInterface { + value: String } operationPlan: operation: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field.yaml index 86ee1c40d7b..0563ad87c9b 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field.yaml @@ -30,8 +30,8 @@ sourceSchemas: query: Query } - interface Votable { - viewerCanVote: Boolean! + type Query { + votables: [Votable] } type Comment implements Votable { @@ -45,8 +45,8 @@ sourceSchemas: viewerRating: Float! } - type Query { - votables: [Votable] + interface Votable { + viewerCanVote: Boolean! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type.yaml index d5f93b30505..5741cdd7e08 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type.yaml @@ -35,8 +35,8 @@ sourceSchemas: query: Query } - interface Votable { - viewerCanVote: Boolean! + type Query { + votables: [Votable] } type Comment implements Votable { @@ -50,8 +50,8 @@ sourceSchemas: title: String! } - type Query { - votables: [Votable] + interface Votable { + viewerCanVote: Boolean! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_Linked_Field_With_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_Linked_Field_With_Dependency.yaml index af8df133ea0..2196d8d96e2 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_Linked_Field_With_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_Linked_Field_With_Dependency.yaml @@ -41,8 +41,8 @@ sourceSchemas: query: Query } - interface Votable { - viewerCanVote: Boolean! + type Query { + votables: [Votable] } type Author @key(fields: "id") { @@ -60,8 +60,8 @@ sourceSchemas: author: Author } - type Query { - votables: [Votable] + interface Votable { + viewerCanVote: Boolean! } interactions: - request: @@ -111,14 +111,14 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! displayName: String! } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_With_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_With_Dependency.yaml index db224a06751..7b2167fadbe 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_With_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_With_Dependency.yaml @@ -35,8 +35,9 @@ sourceSchemas: query: Query } - interface Votable { - viewerCanVote: Boolean! + type Query { + votables: [Votable] + discussionById(id: ID!): Discussion @lookup @shareable } type Comment implements Votable { @@ -49,9 +50,8 @@ sourceSchemas: viewerCanVote: Boolean! } - type Query { - votables: [Votable] - discussionById(id: ID!): Discussion @lookup @shareable + interface Votable { + viewerCanVote: Boolean! } interactions: - request: @@ -95,14 +95,14 @@ sourceSchemas: query: Query } + type Query { + discussionById(id: ID!): Discussion @lookup @shareable + } + type Discussion { id: ID! viewerRating: Float! } - - type Query { - discussionById(id: ID!): Discussion @lookup @shareable - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency.yaml index cd65dfb6b8c..987c734ee23 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency.yaml @@ -42,8 +42,8 @@ sourceSchemas: query: Query } - interface Authorable { - author: Author + type Query { + authorables: [Authorable] } type Author @key(fields: "id") { @@ -58,8 +58,8 @@ sourceSchemas: author: Author } - type Query { - authorables: [Authorable] + interface Authorable { + author: Author } interactions: - request: @@ -106,14 +106,14 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! displayName: String! } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml index 74210e05f02..1d20f15688d 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml @@ -49,8 +49,8 @@ sourceSchemas: query: Query } - interface Authorable { - author: Author + type Query { + authorables: [Authorable] } type Author @key(fields: "id") { @@ -65,8 +65,8 @@ sourceSchemas: author: Author } - type Query { - authorables: [Authorable] + interface Authorable { + author: Author } interactions: - request: @@ -118,15 +118,15 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! displayName: String! email: String } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml index 6fef0c3a945..11c2a7d5096 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml @@ -48,8 +48,8 @@ sourceSchemas: query: Query } - interface Authorable { - author: Author + type Query { + authorables: [Authorable] } type Author @key(fields: "id") { @@ -64,8 +64,8 @@ sourceSchemas: author: Author } - type Query { - authorables: [Authorable] + interface Authorable { + author: Author } interactions: - request: @@ -117,14 +117,14 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! displayName: String! } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type.yaml index a90a090fe35..36084f93b4f 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type.yaml @@ -44,8 +44,8 @@ sourceSchemas: query: Query } - interface Votable { - viewerCanVote: Boolean! + type Query { + wrappers: [Wrapper] } type Comment implements Votable { @@ -59,13 +59,13 @@ sourceSchemas: title: String! } - type Query { - wrappers: [Wrapper] - } - type Wrapper { votable: Votable } + + interface Votable { + viewerCanVote: Boolean! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_Linked_Field_With_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_Linked_Field_With_Dependency.yaml index 99fccf6f299..9785b0d1d00 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_Linked_Field_With_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_Linked_Field_With_Dependency.yaml @@ -52,8 +52,8 @@ sourceSchemas: query: Query } - interface Votable { - viewerCanVote: Boolean! + type Query { + wrappers: [Wrapper] } type Author @key(fields: "id") { @@ -71,13 +71,13 @@ sourceSchemas: author: Author } - type Query { - wrappers: [Wrapper] - } - type Wrapper { votable: Votable } + + interface Votable { + viewerCanVote: Boolean! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -137,14 +137,14 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! displayName: String! } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_With_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_With_Dependency.yaml index 87c94e8eda4..ef2da7d5c74 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_With_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_With_Dependency.yaml @@ -44,8 +44,9 @@ sourceSchemas: query: Query } - interface Votable { - viewerCanVote: Boolean! + type Query { + wrappers: [Wrapper] + discussionById(id: ID!): Discussion @lookup @shareable } type Comment implements Votable { @@ -58,14 +59,13 @@ sourceSchemas: viewerCanVote: Boolean! } - type Query { - wrappers: [Wrapper] - discussionById(id: ID!): Discussion @lookup @shareable - } - type Wrapper { votable: Votable } + + interface Votable { + viewerCanVote: Boolean! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -117,14 +117,14 @@ sourceSchemas: query: Query } + type Query { + discussionById(id: ID!): Discussion @lookup @shareable + } + type Discussion { id: ID! viewerRating: Float! } - - type Query { - discussionById(id: ID!): Discussion @lookup @shareable - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency.yaml index 4486b161aee..527ca337491 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency.yaml @@ -46,8 +46,8 @@ sourceSchemas: query: Query } - interface Authorable { - author: Author + type Query { + wrappers: [Wrapper] } type Author @key(fields: "id") { @@ -62,13 +62,13 @@ sourceSchemas: author: Author } - type Query { - wrappers: [Wrapper] - } - type Wrapper { authorable: Authorable } + + interface Authorable { + author: Author + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -122,14 +122,14 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! displayName: String! } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml index 2e27e458940..9ea07f7cb90 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml @@ -54,8 +54,8 @@ sourceSchemas: query: Query } - interface Authorable { - author: Author + type Query { + wrappers: [Wrapper] } type Author @key(fields: "id") { @@ -70,13 +70,13 @@ sourceSchemas: author: Author } - type Query { - wrappers: [Wrapper] - } - type Wrapper { authorable: Authorable } + + interface Authorable { + author: Author + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -135,15 +135,15 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! displayName: String! email: String } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml index b57a3c0ef2c..48c9cba90ab 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml @@ -51,8 +51,8 @@ sourceSchemas: query: Query } - interface Authorable { - author: Author + type Query { + wrappers: [Wrapper] } type Author @key(fields: "id") { @@ -67,13 +67,13 @@ sourceSchemas: author: Author } - type Query { - wrappers: [Wrapper] - } - type Wrapper { authorable: Authorable } + + interface Authorable { + author: Author + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -132,14 +132,14 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! displayName: String! } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Fetch_Schema_Types_Name.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Fetch_Schema_Types_Name.yaml index 634b56bd4fb..aa7e6ae4525 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Fetch_Schema_Types_Name.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Fetch_Schema_Types_Name.yaml @@ -82,6 +82,20 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + } + type Author @key(fields: "id") { id: Int! } @@ -121,10 +135,15 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } + - name: B + schema: | + schema { + query: Query + } type Query { - bookById(id: Int!): Book @lookup - books( + authorById(id: Int!): Author @internal @lookup + authors( "Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." @@ -133,12 +152,7 @@ sourceSchemas: last: Int "Returns the elements in the list that come before the specified cursor." before: String - ): BooksConnection - } - - name: B - schema: | - schema { - query: Query + ): AuthorsConnection } type Author { @@ -181,20 +195,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Fetch_Specific_Type.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Fetch_Specific_Type.yaml index b3b64a1e407..aa196e40b52 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Fetch_Specific_Type.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Fetch_Specific_Type.yaml @@ -22,6 +22,20 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + } + type Author @key(fields: "id") { id: Int! } @@ -61,10 +75,15 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } + - name: B + schema: | + schema { + query: Query + } type Query { - bookById(id: Int!): Book @lookup - books( + authorById(id: Int!): Author @internal @lookup + authors( "Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." @@ -73,12 +92,7 @@ sourceSchemas: last: Int "Returns the elements in the list that come before the specified cursor." before: String - ): BooksConnection - } - - name: B - schema: | - schema { - query: Query + ): AuthorsConnection } type Author { @@ -121,20 +135,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_DirectiveCapabilitiesQuery.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_DirectiveCapabilitiesQuery.yaml index 1b8aa308929..574d3ad9050 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_DirectiveCapabilitiesQuery.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_DirectiveCapabilitiesQuery.yaml @@ -45,26 +45,6 @@ sourceSchemas: subscription: Subscription } - interface Node @test(arg: "value") { - id: ID! - } - - "Interface description" - interface Votable implements Node { - "Interface field description" - id: ID! - } - - type Mutation @test(arg: "value") { - postReview(input: PostReviewInput): Review @test(arg: "value") - } - - type Post implements Votable & Node @key(fields: "id") { - id: ID! - postKind: PostKind @shareable - location: String @inaccessible - } - "Object type description" type Query @test(arg: "value") { "Object field description" @@ -80,14 +60,34 @@ sourceSchemas: node(id: ID!): Node @lookup } - type Review implements Votable & Node @test(arg: "value") { - id: ID! + type Mutation @test(arg: "value") { + postReview(input: PostReviewInput): Review @test(arg: "value") } type Subscription @test(arg: "value") { onNewReview: Review } + type Post implements Votable & Node @key(fields: "id") { + id: ID! + postKind: PostKind @shareable + location: String @inaccessible + } + + type Review implements Votable & Node @test(arg: "value") { + id: ID! + } + + interface Node @test(arg: "value") { + id: ID! + } + + "Interface description" + interface Votable implements Node { + "Interface field description" + id: ID! + } + "Union description" union UserCreation @test(arg: "value") = Post | Review @@ -113,9 +113,6 @@ sourceSchemas: PHOTO @deprecated(reason: "No longer supported") } - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT - "Directive description" directive @test("Directive argument description" arg: String! = "default") repeatable on QUERY | MUTATION | SUBSCRIPTION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT | VARIABLE_DEFINITION | SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION operationPlan: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_InputValueCapabilitiesQuery.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_InputValueCapabilitiesQuery.yaml index 3b6ae722b87..eaf3f5e3ff8 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_InputValueCapabilitiesQuery.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_InputValueCapabilitiesQuery.yaml @@ -46,26 +46,6 @@ sourceSchemas: subscription: Subscription } - interface Node @test(arg: "value") { - id: ID! - } - - "Interface description" - interface Votable implements Node { - "Interface field description" - id: ID! - } - - type Mutation @test(arg: "value") { - postReview(input: PostReviewInput): Review @test(arg: "value") - } - - type Post implements Votable & Node @key(fields: "id") { - id: ID! - postKind: PostKind @shareable - location: String @inaccessible - } - "Object type description" type Query @test(arg: "value") { "Object field description" @@ -81,14 +61,34 @@ sourceSchemas: node(id: ID!): Node @lookup } - type Review implements Votable & Node @test(arg: "value") { - id: ID! + type Mutation @test(arg: "value") { + postReview(input: PostReviewInput): Review @test(arg: "value") } type Subscription @test(arg: "value") { onNewReview: Review } + type Post implements Votable & Node @key(fields: "id") { + id: ID! + postKind: PostKind @shareable + location: String @inaccessible + } + + type Review implements Votable & Node @test(arg: "value") { + id: ID! + } + + interface Node @test(arg: "value") { + id: ID! + } + + "Interface description" + interface Votable implements Node { + "Interface field description" + id: ID! + } + "Union description" union UserCreation @test(arg: "value") = Post | Review @@ -114,9 +114,6 @@ sourceSchemas: PHOTO @deprecated(reason: "No longer supported") } - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT - "Directive description" directive @test("Directive argument description" arg: String! = "default") repeatable on QUERY | MUTATION | SUBSCRIPTION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT | VARIABLE_DEFINITION | SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION operationPlan: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_IntrospectionQuery.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_IntrospectionQuery.yaml index 73193d7f3a2..9b23178e4af 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_IntrospectionQuery.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_IntrospectionQuery.yaml @@ -1803,26 +1803,6 @@ sourceSchemas: subscription: Subscription } - interface Node @test(arg: "value") { - id: ID! - } - - "Interface description" - interface Votable implements Node { - "Interface field description" - id: ID! - } - - type Mutation @test(arg: "value") { - postReview(input: PostReviewInput): Review @test(arg: "value") - } - - type Post implements Votable & Node @key(fields: "id") { - id: ID! - postKind: PostKind @shareable - location: String @inaccessible - } - "Object type description" type Query @test(arg: "value") { "Object field description" @@ -1838,14 +1818,34 @@ sourceSchemas: node(id: ID!): Node @lookup } - type Review implements Votable & Node @test(arg: "value") { - id: ID! + type Mutation @test(arg: "value") { + postReview(input: PostReviewInput): Review @test(arg: "value") } type Subscription @test(arg: "value") { onNewReview: Review } + type Post implements Votable & Node @key(fields: "id") { + id: ID! + postKind: PostKind @shareable + location: String @inaccessible + } + + type Review implements Votable & Node @test(arg: "value") { + id: ID! + } + + interface Node @test(arg: "value") { + id: ID! + } + + "Interface description" + interface Votable implements Node { + "Interface field description" + id: ID! + } + "Union description" union UserCreation @test(arg: "value") = Post | Review @@ -1871,9 +1871,6 @@ sourceSchemas: PHOTO @deprecated(reason: "No longer supported") } - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT - "Directive description" directive @test("Directive argument description" arg: String! = "default") repeatable on QUERY | MUTATION | SUBSCRIPTION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT | VARIABLE_DEFINITION | SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION operationPlan: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_SchemaCapabilitiesQuery.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_SchemaCapabilitiesQuery.yaml index f0d5b4d6de8..c1b81ad34ce 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_SchemaCapabilitiesQuery.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_SchemaCapabilitiesQuery.yaml @@ -48,26 +48,6 @@ sourceSchemas: subscription: Subscription } - interface Node @test(arg: "value") { - id: ID! - } - - "Interface description" - interface Votable implements Node { - "Interface field description" - id: ID! - } - - type Mutation @test(arg: "value") { - postReview(input: PostReviewInput): Review @test(arg: "value") - } - - type Post implements Votable & Node @key(fields: "id") { - id: ID! - postKind: PostKind @shareable - location: String @inaccessible - } - "Object type description" type Query @test(arg: "value") { "Object field description" @@ -83,14 +63,34 @@ sourceSchemas: node(id: ID!): Node @lookup } - type Review implements Votable & Node @test(arg: "value") { - id: ID! + type Mutation @test(arg: "value") { + postReview(input: PostReviewInput): Review @test(arg: "value") } type Subscription @test(arg: "value") { onNewReview: Review } + type Post implements Votable & Node @key(fields: "id") { + id: ID! + postKind: PostKind @shareable + location: String @inaccessible + } + + type Review implements Votable & Node @test(arg: "value") { + id: ID! + } + + interface Node @test(arg: "value") { + id: ID! + } + + "Interface description" + interface Votable implements Node { + "Interface field description" + id: ID! + } + "Union description" union UserCreation @test(arg: "value") = Post | Review @@ -116,9 +116,6 @@ sourceSchemas: PHOTO @deprecated(reason: "No longer supported") } - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT - "Directive description" directive @test("Directive argument description" arg: String! = "default") repeatable on QUERY | MUTATION | SUBSCRIPTION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT | VARIABLE_DEFINITION | SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION operationPlan: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_TypeCapabilitiesQuery.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_TypeCapabilitiesQuery.yaml index 3f86a084af8..f3106117ead 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_TypeCapabilitiesQuery.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_TypeCapabilitiesQuery.yaml @@ -63,26 +63,6 @@ sourceSchemas: subscription: Subscription } - interface Node @test(arg: "value") { - id: ID! - } - - "Interface description" - interface Votable implements Node { - "Interface field description" - id: ID! - } - - type Mutation @test(arg: "value") { - postReview(input: PostReviewInput): Review @test(arg: "value") - } - - type Post implements Votable & Node @key(fields: "id") { - id: ID! - postKind: PostKind @shareable - location: String @inaccessible - } - "Object type description" type Query @test(arg: "value") { "Object field description" @@ -98,14 +78,34 @@ sourceSchemas: node(id: ID!): Node @lookup } - type Review implements Votable & Node @test(arg: "value") { - id: ID! + type Mutation @test(arg: "value") { + postReview(input: PostReviewInput): Review @test(arg: "value") } type Subscription @test(arg: "value") { onNewReview: Review } + type Post implements Votable & Node @key(fields: "id") { + id: ID! + postKind: PostKind @shareable + location: String @inaccessible + } + + type Review implements Votable & Node @test(arg: "value") { + id: ID! + } + + interface Node @test(arg: "value") { + id: ID! + } + + "Interface description" + interface Votable implements Node { + "Interface field description" + id: ID! + } + "Union description" union UserCreation @test(arg: "value") = Post | Review @@ -131,9 +131,6 @@ sourceSchemas: PHOTO @deprecated(reason: "No longer supported") } - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT - "Directive description" directive @test("Directive argument description" arg: String! = "default") repeatable on QUERY | MUTATION | SUBSCRIPTION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT | VARIABLE_DEFINITION | SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION operationPlan: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Introspection_Field_Type_Without_SelectionSet.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Introspection_Field_Type_Without_SelectionSet.yaml index 58715cd79f2..7df12b12b80 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Introspection_Field_Type_Without_SelectionSet.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Introspection_Field_Type_Without_SelectionSet.yaml @@ -40,26 +40,6 @@ sourceSchemas: subscription: Subscription } - interface Node @test(arg: "value") { - id: ID! - } - - "Interface description" - interface Votable implements Node { - "Interface field description" - id: ID! - } - - type Mutation @test(arg: "value") { - postReview(input: PostReviewInput): Review @test(arg: "value") - } - - type Post implements Votable & Node @key(fields: "id") { - id: ID! - postKind: PostKind @shareable - location: String @inaccessible - } - "Object type description" type Query @test(arg: "value") { "Object field description" @@ -75,14 +55,34 @@ sourceSchemas: node(id: ID!): Node @lookup } - type Review implements Votable & Node @test(arg: "value") { - id: ID! + type Mutation @test(arg: "value") { + postReview(input: PostReviewInput): Review @test(arg: "value") } type Subscription @test(arg: "value") { onNewReview: Review } + type Post implements Votable & Node @key(fields: "id") { + id: ID! + postKind: PostKind @shareable + location: String @inaccessible + } + + type Review implements Votable & Node @test(arg: "value") { + id: ID! + } + + interface Node @test(arg: "value") { + id: ID! + } + + "Interface description" + interface Votable implements Node { + "Interface field description" + id: ID! + } + "Union description" union UserCreation @test(arg: "value") = Post | Review @@ -108,8 +108,5 @@ sourceSchemas: PHOTO @deprecated(reason: "No longer supported") } - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT - "Directive description" directive @test("Directive argument description" arg: String! = "default") repeatable on QUERY | MUTATION | SUBSCRIPTION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT | VARIABLE_DEFINITION | SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Introspection_OfType_Without_SelectionSet.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Introspection_OfType_Without_SelectionSet.yaml index 2f2b03110f9..4680de9fda0 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Introspection_OfType_Without_SelectionSet.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Introspection_OfType_Without_SelectionSet.yaml @@ -40,26 +40,6 @@ sourceSchemas: subscription: Subscription } - interface Node @test(arg: "value") { - id: ID! - } - - "Interface description" - interface Votable implements Node { - "Interface field description" - id: ID! - } - - type Mutation @test(arg: "value") { - postReview(input: PostReviewInput): Review @test(arg: "value") - } - - type Post implements Votable & Node @key(fields: "id") { - id: ID! - postKind: PostKind @shareable - location: String @inaccessible - } - "Object type description" type Query @test(arg: "value") { "Object field description" @@ -75,14 +55,34 @@ sourceSchemas: node(id: ID!): Node @lookup } - type Review implements Votable & Node @test(arg: "value") { - id: ID! + type Mutation @test(arg: "value") { + postReview(input: PostReviewInput): Review @test(arg: "value") } type Subscription @test(arg: "value") { onNewReview: Review } + type Post implements Votable & Node @key(fields: "id") { + id: ID! + postKind: PostKind @shareable + location: String @inaccessible + } + + type Review implements Votable & Node @test(arg: "value") { + id: ID! + } + + interface Node @test(arg: "value") { + id: ID! + } + + "Interface description" + interface Votable implements Node { + "Interface field description" + id: ID! + } + "Union description" union UserCreation @test(arg: "value") = Post | Review @@ -108,8 +108,5 @@ sourceSchemas: PHOTO @deprecated(reason: "No longer supported") } - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT - "Directive description" directive @test("Directive argument description" arg: String! = "default") repeatable on QUERY | MUTATION | SUBSCRIPTION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT | VARIABLE_DEFINITION | SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Introspection_Types.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Introspection_Types.yaml index 5e5f5848ff1..3ec0e87cca6 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Introspection_Types.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Introspection_Types.yaml @@ -462,26 +462,6 @@ sourceSchemas: subscription: Subscription } - interface Node @test(arg: "value") { - id: ID! - } - - "Interface description" - interface Votable implements Node { - "Interface field description" - id: ID! - } - - type Mutation @test(arg: "value") { - postReview(input: PostReviewInput): Review @test(arg: "value") - } - - type Post implements Votable & Node @key(fields: "id") { - id: ID! - postKind: PostKind @shareable - location: String @inaccessible - } - "Object type description" type Query @test(arg: "value") { "Object field description" @@ -497,14 +477,34 @@ sourceSchemas: node(id: ID!): Node @lookup } - type Review implements Votable & Node @test(arg: "value") { - id: ID! + type Mutation @test(arg: "value") { + postReview(input: PostReviewInput): Review @test(arg: "value") } type Subscription @test(arg: "value") { onNewReview: Review } + type Post implements Votable & Node @key(fields: "id") { + id: ID! + postKind: PostKind @shareable + location: String @inaccessible + } + + type Review implements Votable & Node @test(arg: "value") { + id: ID! + } + + interface Node @test(arg: "value") { + id: ID! + } + + "Interface description" + interface Votable implements Node { + "Interface field description" + id: ID! + } + "Union description" union UserCreation @test(arg: "value") = Post | Review @@ -530,9 +530,6 @@ sourceSchemas: PHOTO @deprecated(reason: "No longer supported") } - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT - "Directive description" directive @test("Directive argument description" arg: String! = "default") repeatable on QUERY | MUTATION | SUBSCRIPTION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT | VARIABLE_DEFINITION | SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION operationPlan: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Object.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Object.yaml index 21db13f6c2e..fe2b3cb1322 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Object.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Object.yaml @@ -37,6 +37,20 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + } + type Author @key(fields: "id") { id: Int! } @@ -76,20 +90,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @lookup - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -130,6 +130,20 @@ sourceSchemas: query: Query } + type Query { + authorById(id: Int!): Author @internal @lookup + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + } + type Author { books: [Book!]! id: Int! @@ -170,20 +184,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Object_With_Alias.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Object_With_Alias.yaml index d6375eed362..95539114c23 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Object_With_Alias.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Object_With_Alias.yaml @@ -37,6 +37,20 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + } + type Author @key(fields: "id") { id: Int! } @@ -76,20 +90,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - bookById(id: Int!): Book @lookup - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -130,6 +130,20 @@ sourceSchemas: query: Query } + type Query { + authorById(id: Int!): Author @internal @lookup + authors( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): AuthorsConnection + } + type Author { books: [Book!]! id: Int! @@ -170,20 +184,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query.yaml index 3384f25d273..928def3b3e0 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query.yaml @@ -18,6 +18,20 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + } + type Author @key(fields: "id") { id: Int! } @@ -57,10 +71,15 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } + - name: B + schema: | + schema { + query: Query + } type Query { - bookById(id: Int!): Book @lookup - books( + authorById(id: Int!): Author @internal @lookup + authors( "Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." @@ -69,12 +88,7 @@ sourceSchemas: last: Int "Returns the elements in the list that come before the specified cursor." before: String - ): BooksConnection - } - - name: B - schema: | - schema { - query: Query + ): AuthorsConnection } type Author { @@ -117,20 +131,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query_Skip_False.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query_Skip_False.yaml index a1e277e3654..5412aca8838 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query_Skip_False.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query_Skip_False.yaml @@ -18,6 +18,20 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + } + type Author @key(fields: "id") { id: Int! } @@ -57,10 +71,15 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } + - name: B + schema: | + schema { + query: Query + } type Query { - bookById(id: Int!): Book @lookup - books( + authorById(id: Int!): Author @internal @lookup + authors( "Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." @@ -69,12 +88,7 @@ sourceSchemas: last: Int "Returns the elements in the list that come before the specified cursor." before: String - ): BooksConnection - } - - name: B - schema: | - schema { - query: Query + ): AuthorsConnection } type Author { @@ -117,20 +131,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query_Skip_True.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query_Skip_True.yaml index da5bc516c01..f999a406872 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query_Skip_True.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query_Skip_True.yaml @@ -16,6 +16,20 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + } + type Author @key(fields: "id") { id: Int! } @@ -55,10 +69,15 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } + - name: B + schema: | + schema { + query: Query + } type Query { - bookById(id: Int!): Book @lookup - books( + authorById(id: Int!): Author @internal @lookup + authors( "Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." @@ -67,12 +86,7 @@ sourceSchemas: last: Int "Returns the elements in the list that come before the specified cursor." before: String - ): BooksConnection - } - - name: B - schema: | - schema { - query: Query + ): AuthorsConnection } type Author { @@ -115,20 +129,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query_With_Alias.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query_With_Alias.yaml index 55edcc2c23b..c93b0b0144e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query_With_Alias.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.Typename_On_Query_With_Alias.yaml @@ -18,6 +18,20 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @lookup + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + } + type Author @key(fields: "id") { id: Int! } @@ -57,10 +71,15 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } + - name: B + schema: | + schema { + query: Query + } type Query { - bookById(id: Int!): Book @lookup - books( + authorById(id: Int!): Author @internal @lookup + authors( "Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." @@ -69,12 +88,7 @@ sourceSchemas: last: Int "Returns the elements in the list that come before the specified cursor." before: String - ): BooksConnection - } - - name: B - schema: | - schema { - query: Query + ): AuthorsConnection } type Author { @@ -117,20 +131,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - authorById(id: Int!): Author @internal @lookup - authors( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): AuthorsConnection - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/Issue7996Tests.Mutation_Returned_Viewer_Can_Resolve_Field_From_Another_Subgraph.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/Issue7996Tests.Mutation_Returned_Viewer_Can_Resolve_Field_From_Another_Subgraph.yaml index 498d27bd2cc..5da85b4d2c9 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/Issue7996Tests.Mutation_Returned_Viewer_Can_Resolve_Field_From_Another_Subgraph.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/Issue7996Tests.Mutation_Returned_Viewer_Can_Resolve_Field_From_Another_Subgraph.yaml @@ -31,17 +31,17 @@ sourceSchemas: mutation: Mutation } - type DoSomethingPayload { - something: Int! - viewer: Viewer! + type Query { + viewer: Viewer! @shareable } type Mutation { doSomething: DoSomethingPayload! } - type Query { - viewer: Viewer! @shareable + type DoSomethingPayload { + something: Int! + viewer: Viewer! } type Viewer { diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/LookupTests.Fetch_From_Nested_Internal_Lookup.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/LookupTests.Fetch_From_Nested_Internal_Lookup.yaml index 3d5d0d57f82..55f82bc63ae 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/LookupTests.Fetch_From_Nested_Internal_Lookup.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/LookupTests.Fetch_From_Nested_Internal_Lookup.yaml @@ -43,6 +43,10 @@ sourceSchemas: query: Query } + type Query { + books: [Book!]! + } + type Author @key(fields: "id") { id: ID! } @@ -52,10 +56,6 @@ sourceSchemas: title: String! author: Author! @shareable } - - type Query { - books: [Book!]! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -102,6 +102,10 @@ sourceSchemas: query: Query } + type Query { + lookups: InternalLookups! @internal + } + type Author { id: ID! name: String! @@ -110,10 +114,6 @@ sourceSchemas: type InternalLookups @internal { authorById(id: ID!): Author @lookup } - - type Query { - lookups: InternalLookups! @internal - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/LookupTests.Fetch_OneOf_Lookup_With_Id.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/LookupTests.Fetch_OneOf_Lookup_With_Id.yaml index 0b72bb5feb7..efec5d891aa 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/LookupTests.Fetch_OneOf_Lookup_With_Id.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/LookupTests.Fetch_OneOf_Lookup_With_Id.yaml @@ -48,6 +48,10 @@ sourceSchemas: query: Query } + type Query { + books: [Book!]! + } + type Author @key(fields: "id") { id: ID! } @@ -57,10 +61,6 @@ sourceSchemas: title: String! author: Author! @shareable } - - type Query { - books: [Book!]! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -107,6 +107,10 @@ sourceSchemas: query: Query } + type Query { + lookups: InternalLookups! @internal + } + type Author { id: ID! name: String! @@ -118,17 +122,10 @@ sourceSchemas: @internal } - type Query { - lookups: InternalLookups! @internal - } - input AuthorByInput @oneOf { id: ID name: String } - - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -182,13 +179,13 @@ sourceSchemas: query: Query } - type Author { - name: String! @shareable - } - type Query { topAuthor: Author! } + + type Author { + name: String! @shareable + } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/LookupTests.Fetch_OneOf_Lookup_With_Name.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/LookupTests.Fetch_OneOf_Lookup_With_Name.yaml index 9014593f5df..dc1e6abcc3d 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/LookupTests.Fetch_OneOf_Lookup_With_Name.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/LookupTests.Fetch_OneOf_Lookup_With_Name.yaml @@ -24,6 +24,10 @@ sourceSchemas: query: Query } + type Query { + books: [Book!]! + } + type Author @key(fields: "id") { id: ID! } @@ -33,16 +37,16 @@ sourceSchemas: title: String! author: Author! @shareable } - - type Query { - books: [Book!]! - } - name: b schema: | schema { query: Query } + type Query { + lookups: InternalLookups! @internal + } + type Author { id: ID! name: String! @@ -54,17 +58,10 @@ sourceSchemas: @internal } - type Query { - lookups: InternalLookups! @internal - } - input AuthorByInput @oneOf { id: ID name: String } - - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -100,13 +97,13 @@ sourceSchemas: query: Query } - type Author { - name: String! @shareable - } - type Query { topAuthor: Author! } + + type Author { + name: String! @shareable + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Multiple_Mutation.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Multiple_Mutation.yaml index ab98a884809..64750091acc 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Multiple_Mutation.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Multiple_Mutation.yaml @@ -43,6 +43,14 @@ sourceSchemas: mutation: Mutation } + type Query { + foo: String! + } + + type Mutation { + createBook(input: CreateBookInput!): CreateBookPayload! + } + type Book @key(fields: "id") { id: Int! title: String! @@ -52,14 +60,6 @@ sourceSchemas: book: Book! } - type Mutation { - createBook(input: CreateBookInput!): CreateBookPayload! - } - - type Query { - foo: String! - } - input CreateBookInput { title: String! } @@ -116,14 +116,14 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + } + type Book { id: Int! author: String! } - - type Query { - bookById(id: Int!): Book @internal @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Single_Mutation.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Single_Mutation.yaml index de35051ce90..17a865c2fb4 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Single_Mutation.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Single_Mutation.yaml @@ -29,6 +29,14 @@ sourceSchemas: mutation: Mutation } + type Query { + foo: String! + } + + type Mutation { + createBook(input: CreateBookInput!): CreateBookPayload! + } + type Book @key(fields: "id") { id: Int! title: String! @@ -38,14 +46,6 @@ sourceSchemas: book: Book! } - type Mutation { - createBook(input: CreateBookInput!): CreateBookPayload! - } - - type Query { - foo: String! - } - input CreateBookInput { title: String! } @@ -78,14 +78,14 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + } + type Book { id: Int! author: String! } - - type Query { - bookById(id: Int!): Book @internal @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ProvidesTests.Planner_Should_Route_To_Owning_Source_When_Local_Field_Is_Orphan_External.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ProvidesTests.Planner_Should_Route_To_Owning_Source_When_Local_Field_Is_Orphan_External.yaml index db0594e3794..1eb5cc02cd1 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ProvidesTests.Planner_Should_Route_To_Owning_Source_When_Local_Field_Is_Orphan_External.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ProvidesTests.Planner_Should_Route_To_Owning_Source_When_Local_Field_Is_Orphan_External.yaml @@ -38,16 +38,16 @@ sourceSchemas: query: Query } - type Product @key(fields: "id") { - id: ID! - name: String @external - } - type Query { reviews: [Review] productByName(name: String!): Product @provides(fields: "name") } + type Product @key(fields: "id") { + id: ID! + name: String @external + } + type Review @key(fields: "id") { id: ID! body: String @@ -94,14 +94,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID! @is(field: "id")): Product @lookup @internal + } + type Product @key(fields: "id") { id: ID! name: String } - - type Query { - productById(id: ID! @is(field: "id")): Product @lookup @internal - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ProvidesTests.Provides_Deeply_Nested_Chain.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ProvidesTests.Provides_Deeply_Nested_Chain.yaml index 847c3d5e7a3..adfd5273cc7 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ProvidesTests.Provides_Deeply_Nested_Chain.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ProvidesTests.Provides_Deeply_Nested_Chain.yaml @@ -34,6 +34,10 @@ sourceSchemas: query: Query } + type Query { + root: Root + } + type Level1 @key(fields: "id") { id: ID! level2: Level2 @external @@ -49,10 +53,6 @@ sourceSchemas: value: String @external } - type Query { - root: Root - } - type Root { level1: Level1 @provides(fields: "level2 { level3 { value } }") } @@ -93,6 +93,12 @@ sourceSchemas: query: Query } + type Query { + level1ById(id: ID! @is(field: "id")): Level1 @lookup @internal + level2ById(id: ID! @is(field: "id")): Level2 @lookup @internal + level3ById(id: ID! @is(field: "id")): Level3 @lookup @internal + } + type Level1 @key(fields: "id") { id: ID! level2: Level2 @@ -107,12 +113,6 @@ sourceSchemas: id: ID! value: String } - - type Query { - level1ById(id: ID! @is(field: "id")): Level1 @lookup @internal - level2ById(id: ID! @is(field: "id")): Level2 @lookup @internal - level3ById(id: ID! @is(field: "id")): Level3 @lookup @internal - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ProvidesTests.Provides_On_Interface.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ProvidesTests.Provides_On_Interface.yaml index 4f0df0bee64..2bcc68e864d 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ProvidesTests.Provides_On_Interface.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/ProvidesTests.Provides_On_Interface.yaml @@ -31,8 +31,8 @@ sourceSchemas: query: Query } - interface Animal { - id: ID! + type Query { + book: Book } type Book @key(fields: "id") { @@ -50,8 +50,8 @@ sourceSchemas: tricks: [String] @external } - type Query { - book: Book + interface Animal { + id: ID! } interactions: - request: @@ -89,8 +89,9 @@ sourceSchemas: query: Query } - interface Animal { - id: ID! + type Query { + catById(id: ID! @is(field: "id")): Cat @lookup @internal + dogById(id: ID! @is(field: "id")): Dog @lookup @internal } type Cat implements Animal @key(fields: "id") { @@ -103,9 +104,8 @@ sourceSchemas: tricks: [String] } - type Query { - catById(id: ID! @is(field: "id")): Cat @lookup @internal - dogById(id: ID! @is(field: "id")): Dog @lookup @internal + interface Animal { + id: ID! } operationPlan: operation: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Enumerable_In_List.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Enumerable_In_List.yaml index 85c7bdeaeae..1ddd376d820 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Enumerable_In_List.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Enumerable_In_List.yaml @@ -58,6 +58,20 @@ sourceSchemas: query: Query } + type Query { + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + book(id: Int!): Book @lookup @shareable + } + type Author { id: Int! } @@ -98,20 +112,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - book(id: Int!): Book @lookup @shareable - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -165,6 +165,10 @@ sourceSchemas: query: Query } + type Query { + book(id: Int!): Book @lookup @shareable + } + type Book { id: Int! dimension: BookDimension! @@ -174,16 +178,16 @@ sourceSchemas: width: Int! height: Int! } - - type Query { - book(id: Int!): Book @lookup @shareable - } - name: c schema: | schema { query: Query } + type Query { + book(id: Int!): Book @lookup @shareable + } + type Book { estimatedDelivery( dimension: BookDimensionInput! @require(field: "{\n title\n width: dimension.width\n height: dimension.height\n}") @@ -191,10 +195,6 @@ sourceSchemas: id: Int! } - type Query { - book(id: Int!): Book @lookup @shareable - } - input BookDimensionInput { title: String! width: Int! @@ -206,6 +206,10 @@ sourceSchemas: query: Query } + type Query { + book(id: Int!): Book @lookup @shareable + } + type Book { genres(genreIds: [Int!]! @require(field: "genreIds")): [Genre!]! id: Int! @@ -215,10 +219,6 @@ sourceSchemas: id: Int! name: String! } - - type Query { - book(id: Int!): Book @lookup @shareable - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Object_In_A_List.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Object_In_A_List.yaml index 92622b76223..2ee80e3c339 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Object_In_A_List.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Object_In_A_List.yaml @@ -38,6 +38,20 @@ sourceSchemas: query: Query } + type Query { + books( + "Returns the first _n_ elements from the list." + first: Int + "Returns the elements in the list that come after the specified cursor." + after: String + "Returns the last _n_ elements from the list." + last: Int + "Returns the elements in the list that come before the specified cursor." + before: String + ): BooksConnection + book(id: Int!): Book @lookup @shareable + } + type Author { id: Int! } @@ -78,20 +92,6 @@ sourceSchemas: "When paginating forwards, the cursor to continue." endCursor: String } - - type Query { - books( - "Returns the first _n_ elements from the list." - first: Int - "Returns the elements in the list that come after the specified cursor." - after: String - "Returns the last _n_ elements from the list." - last: Int - "Returns the elements in the list that come before the specified cursor." - before: String - ): BooksConnection - book(id: Int!): Book @lookup @shareable - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -133,6 +133,10 @@ sourceSchemas: query: Query } + type Query { + book(id: Int!): Book @lookup @shareable + } + type Book { id: Int! dimension: BookDimension! @@ -142,10 +146,6 @@ sourceSchemas: width: Int! height: Int! } - - type Query { - book(id: Int!): Book @lookup @shareable - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -212,6 +212,10 @@ sourceSchemas: query: Query } + type Query { + book(id: Int!): Book @lookup @shareable + } + type Book { estimatedDelivery( dimension: BookDimensionInput! @require(field: "{\n title\n width: dimension.width\n height: dimension.height\n}") @@ -219,10 +223,6 @@ sourceSchemas: id: Int! } - type Query { - book(id: Int!): Book @lookup @shareable - } - input BookDimensionInput { title: String! width: Int! @@ -300,6 +300,10 @@ sourceSchemas: query: Query } + type Query { + book(id: Int!): Book @lookup @shareable + } + type Book { genres(genreIds: [Int!]! @require(field: "genreIds")): [Genre!]! id: Int! @@ -309,10 +313,6 @@ sourceSchemas: id: Int! name: String! } - - type Query { - book(id: Int!): Book @lookup @shareable - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Leaf_Field.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Leaf_Field.yaml index b5e17ffbd20..2c929c4ddc9 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Leaf_Field.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Leaf_Field.yaml @@ -22,14 +22,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup @internal + } + type Product { id: ID! nullableField: String } - - type Query { - productById(id: ID!): Product @lookup @internal - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -80,16 +80,16 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + } + type Product { fieldWithNullableRequirement( nullableArgument: String @require(field: "nullableField") ): String! id: ID! } - - type Query { - productById(id: ID!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Nullable_Leaf_Field_Returning_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Nullable_Leaf_Field_Returning_Null.yaml index 557b572924d..cf612aee360 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Nullable_Leaf_Field_Returning_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Nullable_Leaf_Field_Returning_Null.yaml @@ -22,14 +22,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup @internal + } + type Product { id: ID! nullableField: String @null } - - type Query { - productById(id: ID!): Product @lookup @internal - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -80,16 +80,16 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + } + type Product { fieldWithNullableRequirement( nullableArgument: String @require(field: "nullableField") ): String! id: ID! } - - type Query { - productById(id: ID!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Property_Within_Nullable_Object.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Property_Within_Nullable_Object.yaml index fff573f195e..b13836a70b7 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Property_Within_Nullable_Object.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Property_Within_Nullable_Object.yaml @@ -22,15 +22,15 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup @internal + } + type Product { id: ID! nullableObject: Wrapper } - type Query { - productById(id: ID!): Product @lookup @internal - } - type Wrapper { field: String! } @@ -88,16 +88,16 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + } + type Product { fieldWithNullableRequirement( nullableArgument: String @require(field: "nullableObject.field") ): String! id: ID! } - - type Query { - productById(id: ID!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Property_Within_Nullable_Object_Returning_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Property_Within_Nullable_Object_Returning_Null.yaml index 2147ddec512..974d68c5d79 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Property_Within_Nullable_Object_Returning_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Requirement_On_Property_Within_Nullable_Object_Returning_Null.yaml @@ -22,15 +22,15 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup @internal + } + type Product { id: ID! nullableObject: Wrapper @null } - type Query { - productById(id: ID!): Product @lookup @internal - } - type Wrapper { field: String! } @@ -86,16 +86,16 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + } + type Product { fieldWithNullableRequirement( nullableArgument: String @require(field: "nullableObject.field") ): String! id: ID! } - - type Query { - productById(id: ID!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathErrorPocketingTests.Entity_Interface_With_Shared_Value_Type_Under_Inline_Fragment_Pockets_Error.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathErrorPocketingTests.Entity_Interface_With_Shared_Value_Type_Under_Inline_Fragment_Pockets_Error.yaml index fa42da2d896..5ab88668920 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathErrorPocketingTests.Entity_Interface_With_Shared_Value_Type_Under_Inline_Fragment_Pockets_Error.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathErrorPocketingTests.Entity_Interface_With_Shared_Value_Type_Under_Inline_Fragment_Pockets_Error.yaml @@ -40,8 +40,9 @@ sourceSchemas: query: Query } - interface INode @key(fields: "id") { - id: Int! + type Query { + node: INode @shareable + productA(id: Int!): Product @lookup } type Product implements INode @key(fields: "id") { @@ -49,14 +50,13 @@ sourceSchemas: shared: SharedData @shareable @error } - type Query { - node: INode @shareable - productA(id: Int!): Product @lookup - } - type SharedData @shareable { a: String } + + interface INode @key(fields: "id") { + id: Int! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -97,8 +97,9 @@ sourceSchemas: query: Query } - interface INode @key(fields: "id") { - id: Int! + type Query { + node: INode @shareable + productB(id: Int!): Product @lookup } type Product implements INode @key(fields: "id") { @@ -106,14 +107,13 @@ sourceSchemas: shared: SharedData @shareable } - type Query { - node: INode @shareable - productB(id: Int!): Product @lookup - } - type SharedData @shareable { b: String } + + interface INode @key(fields: "id") { + id: Int! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathErrorPocketingTests.Inline_Fragments_With_Duplicate_Response_Name_Should_Not_Drop_Pocketed_Error.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathErrorPocketingTests.Inline_Fragments_With_Duplicate_Response_Name_Should_Not_Drop_Pocketed_Error.yaml index ffb6cc24097..f00446bf69f 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathErrorPocketingTests.Inline_Fragments_With_Duplicate_Response_Name_Should_Not_Drop_Pocketed_Error.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathErrorPocketingTests.Inline_Fragments_With_Duplicate_Response_Name_Should_Not_Drop_Pocketed_Error.yaml @@ -40,8 +40,10 @@ sourceSchemas: query: Query } - interface INode @key(fields: "id") { - id: Int! + type Query { + node: INode @shareable @returns(types: ["Product"]) + productA(id: Int!): Product @lookup + reviewA(id: Int!): Review @lookup } type Product implements INode @key(fields: "id") { @@ -49,12 +51,6 @@ sourceSchemas: shared: SharedData @shareable @error } - type Query { - node: INode @shareable @returns(types: ["Product"]) - productA(id: Int!): Product @lookup - reviewA(id: Int!): Review @lookup - } - type Review implements INode @key(fields: "id") { id: Int! shared: SharedData @shareable @@ -64,6 +60,10 @@ sourceSchemas: a: String b: String } + + interface INode @key(fields: "id") { + id: Int! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -109,8 +109,10 @@ sourceSchemas: query: Query } - interface INode @key(fields: "id") { - id: Int! + type Query { + node: INode @shareable @returns(types: ["Product"]) + productB(id: Int!): Product @lookup + reviewB(id: Int!): Review @lookup } type Product implements INode @key(fields: "id") { @@ -118,12 +120,6 @@ sourceSchemas: shared: SharedData @shareable } - type Query { - node: INode @shareable @returns(types: ["Product"]) - productB(id: Int!): Product @lookup - reviewB(id: Int!): Review @lookup - } - type Review implements INode @key(fields: "id") { id: Int! shared: SharedData @shareable @@ -133,6 +129,10 @@ sourceSchemas: a: String b: String } + + interface INode @key(fields: "id") { + id: Int! + } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup.yaml index f0b9f1c80ca..ffc2081c276 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup.yaml @@ -32,16 +32,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema1: String! - shared: SharedProduct @shareable - } - type Query { productById(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -52,6 +42,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema1: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema1: String! @@ -75,6 +71,10 @@ sourceSchemas: schema1: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: @@ -111,16 +111,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema2: String! - shared: SharedProduct @shareable - } - type Query { product(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -130,6 +120,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema2: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema2: String! @@ -153,6 +149,10 @@ sourceSchemas: schema2: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml index 3de7fb3a5c6..68d8f107746 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml @@ -36,16 +36,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema1: String! - shared: SharedProduct @shareable - } - type Query { productById(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -56,6 +46,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema1: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema1: String! @@ -79,6 +75,10 @@ sourceSchemas: schema1: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: @@ -117,16 +117,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema2: String! - shared: SharedProduct @shareable - } - type Query { product(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -136,6 +126,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema2: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema2: String! @@ -159,6 +155,10 @@ sourceSchemas: schema2: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Levels.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Levels.yaml index 7d44ce1928a..c7d4f546037 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Levels.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Levels.yaml @@ -40,16 +40,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema1: String! - shared: SharedProduct @shareable - } - type Query { productById(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -60,6 +50,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema1: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema1: String! @@ -83,6 +79,10 @@ sourceSchemas: schema1: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: @@ -123,16 +123,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema2: String! - shared: SharedProduct @shareable - } - type Query { product(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -142,6 +132,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema2: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema2: String! @@ -165,6 +161,10 @@ sourceSchemas: schema2: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields.yaml index c51c666f038..3ee1415fe10 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields.yaml @@ -28,16 +28,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema1: String! - shared: SharedProduct @shareable - } - type Query { productById(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -48,6 +38,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema1: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema1: String! @@ -71,6 +67,10 @@ sourceSchemas: schema1: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: @@ -101,16 +101,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema2: String! - shared: SharedProduct @shareable - } - type Query { product(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -120,6 +110,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema2: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema2: String! @@ -143,6 +139,10 @@ sourceSchemas: schema2: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields_With_Extra_Fields_On_Shared_Level.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields_With_Extra_Fields_On_Shared_Level.yaml index ef10252faea..6f5bd450964 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields_With_Extra_Fields_On_Shared_Level.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields_With_Extra_Fields_On_Shared_Level.yaml @@ -34,16 +34,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema1: String! - shared: SharedProduct @shareable - } - type Query { productById(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -54,6 +44,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema1: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema1: String! @@ -77,6 +73,10 @@ sourceSchemas: schema1: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: @@ -109,16 +109,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema2: String! - shared: SharedProduct @shareable - } - type Query { product(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -128,6 +118,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema2: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema2: String! @@ -151,6 +147,10 @@ sourceSchemas: schema2: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup.yaml index 89413b1f645..1dbb1793ed4 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup.yaml @@ -28,16 +28,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema1: String! - shared: SharedProduct @shareable - } - type Query { productById(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -48,6 +38,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema1: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema1: String! @@ -71,6 +67,10 @@ sourceSchemas: schema1: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: @@ -103,16 +103,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema2: String! - shared: SharedProduct @shareable - } - type Query { product(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -122,6 +112,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema2: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema2: String! @@ -145,6 +141,10 @@ sourceSchemas: schema2: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml index a49c2b37acc..2b5802a9f76 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml @@ -32,16 +32,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema1: String! - shared: SharedProduct @shareable - } - type Query { productById(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -52,6 +42,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema1: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema1: String! @@ -75,6 +71,10 @@ sourceSchemas: schema1: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: @@ -109,16 +109,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema2: String! - shared: SharedProduct @shareable - } - type Query { product(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -128,6 +118,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema2: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema2: String! @@ -151,6 +147,10 @@ sourceSchemas: schema2: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Type_Refinement.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Type_Refinement.yaml index b37891258c2..7c02b74274c 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Type_Refinement.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Type_Refinement.yaml @@ -30,16 +30,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema1: String! - shared: SharedProduct @shareable - } - type Query { productById(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -50,6 +40,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema1: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema1: String! @@ -73,6 +69,10 @@ sourceSchemas: schema1: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: @@ -109,16 +109,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema2: String! - shared: SharedProduct @shareable - } - type Query { product(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -128,6 +118,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema2: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema2: String! @@ -151,6 +147,10 @@ sourceSchemas: schema2: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Interface_Root_Field_With_Type_Refinement.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Interface_Root_Field_With_Type_Refinement.yaml index afbb0116ef5..825838c147b 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Interface_Root_Field_With_Type_Refinement.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Interface_Root_Field_With_Type_Refinement.yaml @@ -26,16 +26,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema1: String! - shared: SharedProduct @shareable - } - type Query { productById(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -46,6 +36,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema1: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema1: String! @@ -69,6 +65,10 @@ sourceSchemas: schema1: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: @@ -99,16 +99,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema2: String! - shared: SharedProduct @shareable - } - type Query { product(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -118,6 +108,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema2: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema2: String! @@ -141,6 +137,10 @@ sourceSchemas: schema2: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field.yaml index 569b95c5cd8..254f993bb95 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field.yaml @@ -24,16 +24,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema1: String! - shared: SharedProduct @shareable - } - type Query { productById(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -44,6 +34,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema1: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema1: String! @@ -67,6 +63,10 @@ sourceSchemas: schema1: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: @@ -93,16 +93,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema2: String! - shared: SharedProduct @shareable - } - type Query { product(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -112,6 +102,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema2: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema2: String! @@ -135,6 +131,10 @@ sourceSchemas: schema2: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field_With_Extra_Fields_On_Root.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field_With_Extra_Fields_On_Root.yaml index 0a73ee78378..949e03304b3 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field_With_Extra_Fields_On_Root.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field_With_Extra_Fields_On_Root.yaml @@ -28,16 +28,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema1: String! - shared: SharedProduct @shareable - } - type Query { productById(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -48,6 +38,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema1: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema1: String! @@ -71,6 +67,10 @@ sourceSchemas: schema1: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: @@ -99,16 +99,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema2: String! - shared: SharedProduct @shareable - } - type Query { product(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -118,6 +108,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema2: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema2: String! @@ -141,6 +137,10 @@ sourceSchemas: schema2: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field_With_Inline_Fragment_Without_TypeCondition.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field_With_Inline_Fragment_Without_TypeCondition.yaml index 9ee24cbcf01..d2f19443149 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field_With_Inline_Fragment_Without_TypeCondition.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field_With_Inline_Fragment_Without_TypeCondition.yaml @@ -30,16 +30,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema1: String! - shared: SharedProduct @shareable - } - type Query { productById(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -50,6 +40,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema1: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema1: String! @@ -73,6 +69,10 @@ sourceSchemas: schema1: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: @@ -105,16 +105,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema2: String! - shared: SharedProduct @shareable - } - type Query { product(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -124,6 +114,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema2: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema2: String! @@ -147,6 +143,10 @@ sourceSchemas: schema2: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Union_Root_Field_With_Type_Refinement.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Union_Root_Field_With_Type_Refinement.yaml index c8b3b006821..89ece964fda 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Union_Root_Field_With_Type_Refinement.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Union_Root_Field_With_Type_Refinement.yaml @@ -26,16 +26,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema1: String! - shared: SharedProduct @shareable - } - type Query { productById(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -46,6 +36,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema1: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema1: String! @@ -69,6 +65,10 @@ sourceSchemas: schema1: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: @@ -99,16 +99,6 @@ sourceSchemas: query: Query } - interface IInterface @key(fields: "id") { - id: Int! - } - - type Product implements IInterface { - id: Int! - schema2: String! - shared: SharedProduct @shareable - } - type Query { product(id: Int!): Product @lookup viewer: Viewer! @shareable @@ -118,6 +108,12 @@ sourceSchemas: topReview: Review! @shareable } + type Product implements IInterface { + id: Int! + schema2: String! + shared: SharedProduct @shareable + } + type Review implements IInterface { id: Int! schema2: String! @@ -141,6 +137,10 @@ sourceSchemas: schema2: String! } + interface IInterface @key(fields: "id") { + id: Int! + } + union IUnion = Product | Review interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_CustomAcceptHeader.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_CustomAcceptHeader.yaml index f23d19798ad..04128c845ee 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_CustomAcceptHeader.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_CustomAcceptHeader.yaml @@ -27,6 +27,12 @@ sourceSchemas: query: Query } + type Query { + books: [Book!]! + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { id: ID! } @@ -36,12 +42,6 @@ sourceSchemas: id: ID! title: String! } - - type Query { - books: [Book!]! - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -72,6 +72,11 @@ sourceSchemas: query: Query } + type Query { + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { name(postFix: String): String! id: ID! @@ -81,11 +86,6 @@ sourceSchemas: rating: String! id: ID! } - - type Query { - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/jsonl diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyRequestBatching.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyRequestBatching.yaml index a824d2bf0da..567ecdcc1ac 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyRequestBatching.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyRequestBatching.yaml @@ -27,6 +27,12 @@ sourceSchemas: query: Query } + type Query { + books: [Book!]! + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { id: ID! } @@ -36,12 +42,6 @@ sourceSchemas: id: ID! title: String! } - - type Query { - books: [Book!]! - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -72,6 +72,11 @@ sourceSchemas: query: Query } + type Query { + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { name(postFix: String): String! id: ID! @@ -81,11 +86,6 @@ sourceSchemas: rating: String! id: ID! } - - type Query { - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyRequestBatching_ServerReturnsJsonArray.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyRequestBatching_ServerReturnsJsonArray.yaml index 1adc6e2f782..2fab8c6aed1 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyRequestBatching_ServerReturnsJsonArray.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyRequestBatching_ServerReturnsJsonArray.yaml @@ -27,6 +27,12 @@ sourceSchemas: query: Query } + type Query { + books: [Book!]! + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { id: ID! } @@ -36,12 +42,6 @@ sourceSchemas: id: ID! title: String! } - - type Query { - books: [Book!]! - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -72,6 +72,11 @@ sourceSchemas: query: Query } + type Query { + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { name(postFix: String): String! id: ID! @@ -81,11 +86,6 @@ sourceSchemas: rating: String! id: ID! } - - type Query { - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyRequestBatching_ServerReturnsNoRequestIndices.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyRequestBatching_ServerReturnsNoRequestIndices.yaml index c3617f9c3d7..1f127b96edb 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyRequestBatching_ServerReturnsNoRequestIndices.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyRequestBatching_ServerReturnsNoRequestIndices.yaml @@ -27,6 +27,12 @@ sourceSchemas: query: Query } + type Query { + books: [Book!]! + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { id: ID! } @@ -36,12 +42,6 @@ sourceSchemas: id: ID! title: String! } - - type Query { - books: [Book!]! - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -72,6 +72,11 @@ sourceSchemas: query: Query } + type Query { + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { name(postFix: String): String! id: ID! @@ -81,11 +86,6 @@ sourceSchemas: rating: String! id: ID! } - - type Query { - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyVariableBatching.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyVariableBatching.yaml index 24dac7906cc..3ecc9afe4ea 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyVariableBatching.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.BatchRequest_OnlyVariableBatching.yaml @@ -27,6 +27,12 @@ sourceSchemas: query: Query } + type Query { + books: [Book!]! + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { id: ID! } @@ -36,12 +42,6 @@ sourceSchemas: id: ID! title: String! } - - type Query { - books: [Book!]! - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -72,6 +72,11 @@ sourceSchemas: query: Query } + type Query { + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { name(postFix: String): String! id: ID! @@ -81,11 +86,6 @@ sourceSchemas: rating: String! id: ID! } - - type Query { - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_CustomAcceptHeader.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_CustomAcceptHeader.yaml index 7ff30a3ec35..582e66cfd98 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_CustomAcceptHeader.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_CustomAcceptHeader.yaml @@ -42,6 +42,12 @@ sourceSchemas: query: Query } + type Query { + books: [Book!]! + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { id: ID! } @@ -51,12 +57,6 @@ sourceSchemas: id: ID! title: String! } - - type Query { - books: [Book!]! - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -102,6 +102,11 @@ sourceSchemas: query: Query } + type Query { + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { name(postFix: String): String! id: ID! @@ -111,11 +116,6 @@ sourceSchemas: rating: String! id: ID! } - - type Query { - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/jsonl diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyRequestBatching.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyRequestBatching.yaml index ea8d90c6d2e..9479858f6f8 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyRequestBatching.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyRequestBatching.yaml @@ -42,6 +42,12 @@ sourceSchemas: query: Query } + type Query { + books: [Book!]! + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { id: ID! } @@ -51,12 +57,6 @@ sourceSchemas: id: ID! title: String! } - - type Query { - books: [Book!]! - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -102,6 +102,11 @@ sourceSchemas: query: Query } + type Query { + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { name(postFix: String): String! id: ID! @@ -111,11 +116,6 @@ sourceSchemas: rating: String! id: ID! } - - type Query { - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyRequestBatching_ServerReturnsJsonArray.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyRequestBatching_ServerReturnsJsonArray.yaml index e82527b6a97..8618d9b357c 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyRequestBatching_ServerReturnsJsonArray.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyRequestBatching_ServerReturnsJsonArray.yaml @@ -72,6 +72,12 @@ sourceSchemas: query: Query } + type Query { + books: [Book!]! + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { id: ID! } @@ -81,12 +87,6 @@ sourceSchemas: id: ID! title: String! } - - type Query { - books: [Book!]! - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -132,6 +132,11 @@ sourceSchemas: query: Query } + type Query { + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { name(postFix: String): String! id: ID! @@ -141,11 +146,6 @@ sourceSchemas: rating: String! id: ID! } - - type Query { - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyRequestBatching_ServerReturnsNoRequestIndices.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyRequestBatching_ServerReturnsNoRequestIndices.yaml index 7a6e081167d..a1d84904ac2 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyRequestBatching_ServerReturnsNoRequestIndices.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyRequestBatching_ServerReturnsNoRequestIndices.yaml @@ -72,6 +72,12 @@ sourceSchemas: query: Query } + type Query { + books: [Book!]! + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { id: ID! } @@ -81,12 +87,6 @@ sourceSchemas: id: ID! title: String! } - - type Query { - books: [Book!]! - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -132,6 +132,11 @@ sourceSchemas: query: Query } + type Query { + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { name(postFix: String): String! id: ID! @@ -141,11 +146,6 @@ sourceSchemas: rating: String! id: ID! } - - type Query { - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyVariableBatching.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyVariableBatching.yaml index 0797275ee33..5235697e53c 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyVariableBatching.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.OperationBatch_BatchRequest_OnlyVariableBatching.yaml @@ -42,6 +42,12 @@ sourceSchemas: query: Query } + type Query { + books: [Book!]! + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { id: ID! } @@ -51,12 +57,6 @@ sourceSchemas: id: ID! title: String! } - - type Query { - books: [Book!]! - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -102,6 +102,11 @@ sourceSchemas: query: Query } + type Query { + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { name(postFix: String): String! id: ID! @@ -111,11 +116,6 @@ sourceSchemas: rating: String! id: ID! } - - type Query { - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.SingularRequest_CustomAcceptHeader.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.SingularRequest_CustomAcceptHeader.yaml index f8be9d9b439..83dd7738883 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.SingularRequest_CustomAcceptHeader.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaClientCapabilitiesTests.SingularRequest_CustomAcceptHeader.yaml @@ -27,6 +27,12 @@ sourceSchemas: query: Query } + type Query { + books: [Book!]! + bookById(id: ID!): Book @lookup @internal + authorById(id: ID!): Author @lookup @internal + } + type Author { id: ID! } @@ -36,12 +42,6 @@ sourceSchemas: id: ID! title: String! } - - type Query { - books: [Book!]! - bookById(id: ID!): Book @lookup @internal - authorById(id: ID!): Author @lookup @internal - } interactions: - request: accept: application/json diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_In_List_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_In_List_OnError_Null.yaml index 025ae0c13ae..83cf6bdb0a4 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_In_List_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_In_List_OnError_Null.yaml @@ -61,17 +61,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -109,14 +109,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_In_List_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_In_List_OnError_Propagate.yaml index 2723e018429..e58b5e5d6c0 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_In_List_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_In_List_OnError_Propagate.yaml @@ -60,17 +60,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -108,14 +108,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_OnError_Null.yaml index 88f706c8204..1c73e04e4ca 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_OnError_Null.yaml @@ -34,17 +34,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -72,14 +72,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_OnError_Propagate.yaml index 8c9abf20be7..7ab17114708 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Field_OnError_Propagate.yaml @@ -33,17 +33,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -71,14 +71,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_NonNull_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_NonNull_OnError_Null.yaml index 861be01e296..52dfed2e497 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_NonNull_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_NonNull_OnError_Null.yaml @@ -61,17 +61,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -109,14 +109,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_NonNull_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_NonNull_OnError_Propagate.yaml index 85614f2bc01..6121dd54f1c 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_NonNull_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_NonNull_OnError_Propagate.yaml @@ -28,17 +28,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -76,14 +76,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_OnError_Null.yaml index f14ca7220cb..8b4d28463b3 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_OnError_Null.yaml @@ -61,17 +61,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -109,14 +109,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_OnError_Propagate.yaml index d97be01ac5e..aee474a6fad 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_In_List_OnError_Propagate.yaml @@ -60,17 +60,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -108,14 +108,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_NonNull_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_NonNull_OnError_Null.yaml index c2261024fff..53a4ab9dd94 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_NonNull_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_NonNull_OnError_Null.yaml @@ -34,17 +34,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -72,14 +72,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_NonNull_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_NonNull_OnError_Propagate.yaml index 0db5c6b46dc..dcf1c8c2670 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_NonNull_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_NonNull_OnError_Propagate.yaml @@ -27,17 +27,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -65,14 +65,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_OnError_Null.yaml index f48a3f4468e..61508a9239b 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_OnError_Null.yaml @@ -34,17 +34,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -72,14 +72,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_OnError_Propagate.yaml index ca984e4abb2..7f452e8700d 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Lookup_Leaf_OnError_Propagate.yaml @@ -33,17 +33,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -71,14 +71,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Field_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Field_OnError_Null.yaml index 09f2fb80b05..f81de6ecdd1 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Field_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Field_OnError_Null.yaml @@ -29,14 +29,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Field_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Field_OnError_Propagate.yaml index bb7e63a72a5..110c5102582 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Field_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Field_OnError_Propagate.yaml @@ -28,14 +28,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Leaf_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Leaf_OnError_Null.yaml index 1ff106865cc..a69d23ec1a6 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Leaf_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Leaf_OnError_Null.yaml @@ -32,14 +32,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Leaf_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Leaf_OnError_Propagate.yaml index 7950a93175e..ccf98fb9692 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Leaf_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.Error_On_Root_Leaf_OnError_Propagate.yaml @@ -31,14 +31,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Lookup_Leaf_NonNull_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Lookup_Leaf_NonNull_OnError_Null.yaml index 7d56036cfa9..1b4f43623ee 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Lookup_Leaf_NonNull_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Lookup_Leaf_NonNull_OnError_Null.yaml @@ -34,17 +34,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -72,14 +72,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Lookup_Leaf_NonNull_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Lookup_Leaf_NonNull_OnError_Propagate.yaml index 0bf22d369a6..98bc37edf5f 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Lookup_Leaf_NonNull_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Lookup_Leaf_NonNull_OnError_Propagate.yaml @@ -27,17 +27,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -65,14 +65,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Root_Field_NonNull_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Root_Field_NonNull_OnError_Null.yaml index 3ec946a607e..a7e46b8036a 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Root_Field_NonNull_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Root_Field_NonNull_OnError_Null.yaml @@ -29,14 +29,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Root_Field_NonNull_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Root_Field_NonNull_OnError_Propagate.yaml index fc9b487fde2..58cc0980fc3 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Root_Field_NonNull_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_With_Path_For_Root_Field_NonNull_OnError_Propagate.yaml @@ -28,14 +28,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Lookup_Field_NonNull_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Lookup_Field_NonNull_OnError_Null.yaml index d80d0a78667..7f2c36da889 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Lookup_Field_NonNull_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Lookup_Field_NonNull_OnError_Null.yaml @@ -37,17 +37,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -75,14 +75,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Lookup_Field_NonNull_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Lookup_Field_NonNull_OnError_Propagate.yaml index 0b0dfc755b7..09fa8db54cb 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Lookup_Field_NonNull_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Lookup_Field_NonNull_OnError_Propagate.yaml @@ -30,17 +30,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -68,14 +68,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_NonNull_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_NonNull_OnError_Null.yaml index d2178dbce5d..4374045bb31 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_NonNull_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_NonNull_OnError_Null.yaml @@ -32,14 +32,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_NonNull_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_NonNull_OnError_Propagate.yaml index c46d5609c2b..3b14899dc6c 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_NonNull_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_NonNull_OnError_Propagate.yaml @@ -31,14 +31,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_OnError_Null.yaml index 9482d935a51..13d4622926f 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_OnError_Null.yaml @@ -32,14 +32,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_OnError_Propagate.yaml index 5535e381e27..a2be0622d07 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.No_Data_And_Error_Without_Path_For_Root_Field_OnError_Propagate.yaml @@ -31,14 +31,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.OnError_Null_OnSourceSchema_Forwards_To_Subgraph_Request.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.OnError_Null_OnSourceSchema_Forwards_To_Subgraph_Request.yaml index 2b7ece205f6..63bb50e881c 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.OnError_Null_OnSourceSchema_Forwards_To_Subgraph_Request.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.OnError_Null_OnSourceSchema_Forwards_To_Subgraph_Request.yaml @@ -28,14 +28,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.OnError_SchemaDefault_Null_AppliesWithoutPerRequestOverride.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.OnError_SchemaDefault_Null_AppliesWithoutPerRequestOverride.yaml index 674c7606273..eb875e7f98e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.OnError_SchemaDefault_Null_AppliesWithoutPerRequestOverride.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.OnError_SchemaDefault_Null_AppliesWithoutPerRequestOverride.yaml @@ -28,14 +28,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_NonNull_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_NonNull_OnError_Null.yaml index cbb41420ad7..ac167bd2725 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_NonNull_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_NonNull_OnError_Null.yaml @@ -34,17 +34,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -72,14 +72,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_NonNull_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_NonNull_OnError_Propagate.yaml index 0ca7441ec11..79319bb245e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_NonNull_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_NonNull_OnError_Propagate.yaml @@ -27,17 +27,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -65,14 +65,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_OnError_Null.yaml index f7cdfa6e650..11eedabdf51 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_OnError_Null.yaml @@ -34,17 +34,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -72,14 +72,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_OnError_Propagate.yaml index a2666a05d26..a2cbd4606c6 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_OnError_Propagate.yaml @@ -33,17 +33,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -71,14 +71,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_NonNull_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_NonNull_OnError_Null.yaml index 667e6f795c9..d7249f6950d 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_NonNull_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_NonNull_OnError_Null.yaml @@ -61,17 +61,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -109,14 +109,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_NonNull_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_NonNull_OnError_Propagate.yaml index ea6afa897b1..39764677afa 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_NonNull_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_NonNull_OnError_Propagate.yaml @@ -28,17 +28,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -76,14 +76,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String! id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_OnError_Null.yaml index a3326b7583f..879a3bdf913 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_OnError_Null.yaml @@ -61,17 +61,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -109,14 +109,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_OnError_Propagate.yaml index fd90b621e31..77d09f0e86a 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Lookup_On_List_OnError_Propagate.yaml @@ -60,17 +60,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -108,14 +108,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: Int!): Product @lookup + } + type Product { name: String id: Int! } - - type Query { - productById(id: Int!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_NonNull_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_NonNull_OnError_Null.yaml index 70ea0f2ac3f..6c1dc59d92b 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_NonNull_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_NonNull_OnError_Null.yaml @@ -29,17 +29,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_NonNull_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_NonNull_OnError_Propagate.yaml index cc2112301bd..3d0326d80c8 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_NonNull_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_NonNull_OnError_Propagate.yaml @@ -25,17 +25,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_OnError_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_OnError_Null.yaml index 21bf28a7469..dfb1839e510 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_OnError_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_OnError_Null.yaml @@ -29,17 +29,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_OnError_Propagate.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_OnError_Propagate.yaml index cd4281c8aa9..e637395f185 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_OnError_Propagate.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SourceSchemaErrorTests.SourceSchema_Request_Fails_For_Root_Field_OnError_Propagate.yaml @@ -28,17 +28,17 @@ sourceSchemas: query: Query } - type Product { - id: Int! - price: Float! - } - type Query { topProduct: Product! nullableTopProduct: Product topProducts: [Product!]! productById(id: Int!): Product @lookup @internal } + + type Product { + id: Int! + price: Float! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SubscriptionsOverHttpStoreTests.Subscribe_Simple.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SubscriptionsOverHttpStoreTests.Subscribe_Simple.yaml index dc198ef698b..7659f80ef13 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SubscriptionsOverHttpStoreTests.Subscribe_Simple.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/SubscriptionsOverHttpStoreTests.Subscribe_Simple.yaml @@ -43,10 +43,6 @@ sourceSchemas: subscription: Subscription } - type Book @key(fields: "id") { - id: Int! - } - type Query { foo: String! } @@ -54,6 +50,10 @@ sourceSchemas: type Subscription { onBookCreated: Book! } + + type Book @key(fields: "id") { + id: Int! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -96,14 +96,14 @@ sourceSchemas: query: Query } + type Query { + bookById(id: Int!): Book @internal @lookup + } + type Book { id: Int! title: String! } - - type Query { - bookById(id: Int!): Book @internal @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Has_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Has_Dependency.yaml index 8e495c6e936..c02b6dc76dd 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Has_Dependency.yaml @@ -43,6 +43,10 @@ sourceSchemas: query: Query } + type Query { + postEdges: [PostEdge] + } + type Discussion { id: ID! subgraph1: String @@ -56,10 +60,6 @@ sourceSchemas: node: Post } - type Query { - postEdges: [PostEdge] - } - union Post = Photo | Discussion interactions: - request: @@ -111,14 +111,14 @@ sourceSchemas: query: Query } + type Query { + photoById(id: ID!): Photo @lookup + } + type Photo { id: ID! subgraph2: String! } - - type Query { - photoById(id: ID!): Photo @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selection_Has_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selection_Has_Dependency.yaml index 3a73458bf72..8e70c2f46d5 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selection_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selection_Has_Dependency.yaml @@ -53,6 +53,10 @@ sourceSchemas: query: Query } + type Query { + postEdges: [PostEdge] + } + type Author @key(fields: "id") { id: ID! } @@ -75,10 +79,6 @@ sourceSchemas: id: ID! } - type Query { - postEdges: [PostEdge] - } - union Post = Photo | Discussion interactions: - request: @@ -140,14 +140,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + } + type Product { id: ID! subgraph2: String! } - - type Query { - productById(id: ID!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -202,14 +202,14 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! subgraph3: String! } - - type Query { - authorById(id: ID!): Author @lookup - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml index 58941f407e1..684facc4370 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml @@ -53,6 +53,10 @@ sourceSchemas: query: Query } + type Query { + postEdges: [PostEdge] + } + type Author @key(fields: "id") { id: ID! } @@ -75,10 +79,6 @@ sourceSchemas: id: ID! } - type Query { - postEdges: [PostEdge] - } - union Post = Photo | Discussion interactions: - request: @@ -140,6 +140,11 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + authorById(id: ID!): Author @lookup + } + type Author { id: ID! subgraph2: String! @@ -149,11 +154,6 @@ sourceSchemas: id: ID! subgraph2: String! } - - type Query { - productById(id: ID!): Product @lookup - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml index a48503817b6..1ed17583abb 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml @@ -53,6 +53,10 @@ sourceSchemas: query: Query } + type Query { + postEdges: [PostEdge] + } + type Discussion { id: ID! product: Product @@ -71,10 +75,6 @@ sourceSchemas: id: ID! } - type Query { - postEdges: [PostEdge] - } - union Post = Photo | Discussion interactions: - request: @@ -136,14 +136,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + } + type Product { id: ID! subgraph2: String! } - - type Query { - productById(id: ID!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Has_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Has_Dependency.yaml index ed02ee3a665..63af840cc7c 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Has_Dependency.yaml @@ -67,6 +67,10 @@ sourceSchemas: query: Query } + type Query { + users: [User] + } + type Discussion { id: ID! subgraph1: String @@ -76,10 +80,6 @@ sourceSchemas: id: ID! } - type Query { - users: [User] - } - type User { posts: [Post] } @@ -165,14 +165,14 @@ sourceSchemas: query: Query } + type Query { + photoById(id: ID!): Photo @lookup + } + type Photo { id: ID! subgraph2: String! } - - type Query { - photoById(id: ID!): Photo @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selection_Has_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selection_Has_Dependency.yaml index 2c7ec24f195..1b31f7f7aeb 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selection_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selection_Has_Dependency.yaml @@ -89,6 +89,10 @@ sourceSchemas: query: Query } + type Query { + users: [User] + } + type Author @key(fields: "id") { id: ID! } @@ -107,10 +111,6 @@ sourceSchemas: id: ID! } - type Query { - users: [User] - } - type User { posts: [Post] } @@ -218,14 +218,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + } + type Product { id: ID! subgraph2: String! } - - type Query { - productById(id: ID!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -313,14 +313,14 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! subgraph3: String! } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml index 296403a2a51..61a40074b18 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml @@ -89,6 +89,10 @@ sourceSchemas: query: Query } + type Query { + users: [User] + } + type Author @key(fields: "id") { id: ID! } @@ -107,10 +111,6 @@ sourceSchemas: id: ID! } - type Query { - users: [User] - } - type User { posts: [Post] } @@ -218,6 +218,11 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + authorById(id: ID!): Author @lookup + } + type Author { id: ID! subgraph2: String! @@ -227,11 +232,6 @@ sourceSchemas: id: ID! subgraph2: String! } - - type Query { - productById(id: ID!): Product @lookup - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml index ff392e1d7b0..48bb0b60280 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml @@ -89,6 +89,10 @@ sourceSchemas: query: Query } + type Query { + users: [User] + } + type Discussion { id: ID! product: Product @@ -103,10 +107,6 @@ sourceSchemas: id: ID! } - type Query { - users: [User] - } - type User { posts: [Post] } @@ -214,14 +214,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + } + type Product { id: ID! subgraph2: String! } - - type Query { - productById(id: ID!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Has_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Has_Dependency.yaml index e2a1b7c6c95..28661990412 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Has_Dependency.yaml @@ -27,6 +27,10 @@ sourceSchemas: query: Query } + type Query { + post: Post + } + type Discussion { id: ID! subgraph1: String @@ -36,10 +40,6 @@ sourceSchemas: id: ID! } - type Query { - post: Post - } - union Post = Photo | Discussion interactions: - request: @@ -73,14 +73,14 @@ sourceSchemas: query: Query } + type Query { + photoById(id: ID!): Photo @lookup + } + type Photo { id: ID! subgraph2: String! } - - type Query { - photoById(id: ID!): Photo @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selection_Has_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selection_Has_Dependency.yaml index 45c22644aee..e884662332d 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selection_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selection_Has_Dependency.yaml @@ -33,6 +33,10 @@ sourceSchemas: query: Query } + type Query { + post: Post + } + type Author @key(fields: "id") { id: ID! } @@ -51,10 +55,6 @@ sourceSchemas: id: ID! } - type Query { - post: Post - } - union Post = Photo | Discussion interactions: - request: @@ -94,14 +94,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + } + type Product { id: ID! subgraph2: String! } - - type Query { - productById(id: ID!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -131,14 +131,14 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! subgraph3: String! } - - type Query { - authorById(id: ID!): Author @lookup - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml index 2846410af26..95be01658b2 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml @@ -33,6 +33,10 @@ sourceSchemas: query: Query } + type Query { + post: Post + } + type Author @key(fields: "id") { id: ID! } @@ -51,10 +55,6 @@ sourceSchemas: id: ID! } - type Query { - post: Post - } - union Post = Photo | Discussion interactions: - request: @@ -94,6 +94,11 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + authorById(id: ID!): Author @lookup + } + type Author { id: ID! subgraph2: String! @@ -103,11 +108,6 @@ sourceSchemas: id: ID! subgraph2: String! } - - type Query { - productById(id: ID!): Product @lookup - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml index 983e0c34393..f1ef954f9a1 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml @@ -33,6 +33,10 @@ sourceSchemas: query: Query } + type Query { + post: Post + } + type Discussion { id: ID! product: Product @@ -47,10 +51,6 @@ sourceSchemas: id: ID! } - type Query { - post: Post - } - union Post = Photo | Discussion interactions: - request: @@ -90,14 +90,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + } + type Product { id: ID! subgraph2: String! } - - type Query { - productById(id: ID!): Product @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Just_Typename_Selected.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Just_Typename_Selected.yaml index 24a9b960039..8087e68b001 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Just_Typename_Selected.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Just_Typename_Selected.yaml @@ -22,6 +22,10 @@ sourceSchemas: query: Query } + type Query { + post: Post + } + type Discussion { id: ID! title: String @@ -32,10 +36,6 @@ sourceSchemas: imageUrl: String! } - type Query { - post: Post - } - union Post = Photo | Discussion interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Has_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Has_Dependency.yaml index 4bcf7441efa..44cd3755854 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Has_Dependency.yaml @@ -35,6 +35,10 @@ sourceSchemas: query: Query } + type Query { + posts: [Post] + } + type Discussion { id: ID! subgraph1: String @@ -44,10 +48,6 @@ sourceSchemas: id: ID! } - type Query { - posts: [Post] - } - union Post = Photo | Discussion interactions: - request: @@ -91,14 +91,14 @@ sourceSchemas: query: Query } + type Query { + photoById(id: ID!): Photo @lookup + } + type Photo { id: ID! subgraph2: String! } - - type Query { - photoById(id: ID!): Photo @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selection_Has_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selection_Has_Dependency.yaml index 69cfd705ec7..1694f53757f 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selection_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selection_Has_Dependency.yaml @@ -45,6 +45,10 @@ sourceSchemas: query: Query } + type Query { + posts: [Post] + } + type Author @key(fields: "id") { id: ID! } @@ -63,10 +67,6 @@ sourceSchemas: id: ID! } - type Query { - posts: [Post] - } - union Post = Photo | Discussion interactions: - request: @@ -120,14 +120,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + } + type Product { id: ID! subgraph2: String! } - - type Query { - productById(id: ID!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -171,14 +171,14 @@ sourceSchemas: query: Query } + type Query { + authorById(id: ID!): Author @lookup + } + type Author { id: ID! subgraph3: String! } - - type Query { - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml index 5bffda6ed38..89a3837e84b 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml @@ -45,6 +45,10 @@ sourceSchemas: query: Query } + type Query { + posts: [Post] + } + type Author @key(fields: "id") { id: ID! } @@ -63,10 +67,6 @@ sourceSchemas: id: ID! } - type Query { - posts: [Post] - } - union Post = Photo | Discussion interactions: - request: @@ -120,6 +120,11 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + authorById(id: ID!): Author @lookup + } + type Author { id: ID! subgraph2: String! @@ -129,11 +134,6 @@ sourceSchemas: id: ID! subgraph2: String! } - - type Query { - productById(id: ID!): Product @lookup - authorById(id: ID!): Author @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml index a647e2f1bbc..f0a1e6a8961 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml @@ -45,6 +45,10 @@ sourceSchemas: query: Query } + type Query { + posts: [Post] + } + type Discussion { id: ID! product: Product @@ -59,10 +63,6 @@ sourceSchemas: id: ID! } - type Query { - posts: [Post] - } - union Post = Photo | Discussion interactions: - request: @@ -116,14 +116,14 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup + } + type Product { id: ID! subgraph2: String! } - - type Query { - productById(id: ID!): Product @lookup - } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_Multiple_Options_Provided.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_Multiple_Options_Provided.yaml index 114fc548086..335ce3b22f9 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_Multiple_Options_Provided.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_Multiple_Options_Provided.yaml @@ -53,6 +53,3 @@ sourceSchemas: dog: Dog cat: Cat } - - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_No_Option_Provided.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_No_Option_Provided.yaml index e65e9d499a2..7bb39e3bfc9 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_No_Option_Provided.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_No_Option_Provided.yaml @@ -46,6 +46,3 @@ sourceSchemas: dog: Dog cat: Cat } - - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_Only_One_Option_Provided.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_Only_One_Option_Provided.yaml index ff0e54bf281..696592889c1 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_Only_One_Option_Provided.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_Only_One_Option_Provided.yaml @@ -42,9 +42,6 @@ sourceSchemas: dog: Dog cat: Cat } - - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_Only_One_Option_Provided_But_Value_Is_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_Only_One_Option_Provided_But_Value_Is_Null.yaml index c8bc977f54c..15cca9124d2 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_Only_One_Option_Provided_But_Value_Is_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/VariableCoercionTests.OneOf_Only_One_Option_Provided_But_Value_Is_Null.yaml @@ -49,6 +49,3 @@ sourceSchemas: dog: Dog cat: Cat } - - "The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object." - directive @oneOf on INPUT_OBJECT diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_AutoCompose.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_AutoCompose.yaml index 5fa36d3247d..974aa15e532 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_AutoCompose.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_AutoCompose.yaml @@ -58,10 +58,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -76,6 +72,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -109,8 +109,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -119,12 +121,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -137,6 +133,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -170,8 +170,11 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -183,13 +186,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -198,6 +194,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_Introspection.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_Introspection.yaml index b99f30d0961..0f4750fd94e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_Introspection.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_Introspection.yaml @@ -613,10 +613,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -631,14 +627,20 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } - name: B schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -647,12 +649,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -665,14 +661,21 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } - name: C schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -684,13 +687,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -699,6 +695,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_Query_TopProducts.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_Query_TopProducts.yaml index b74d03c5227..2b3633d9458 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_Query_TopProducts.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_Query_TopProducts.yaml @@ -96,10 +96,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -114,6 +110,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -246,8 +246,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -256,12 +258,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -274,6 +270,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -396,8 +396,11 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -409,13 +412,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -424,6 +420,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_Query_TypeName.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_Query_TypeName.yaml index 81b5912ad5e..9d322bf81a1 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_Query_TypeName.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_Query_TypeName.yaml @@ -98,10 +98,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -116,14 +112,20 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } - name: B schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -132,12 +134,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -150,6 +146,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -272,8 +272,11 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -285,13 +288,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -300,6 +296,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_With_Variables.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_With_Variables.yaml index 0c90fa0ae96..510992c3450 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_With_Variables.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_And_Products_With_Variables.yaml @@ -34,10 +34,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -52,14 +48,20 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } - name: B schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -68,12 +70,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -86,14 +82,21 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } - name: C schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -105,13 +108,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -120,6 +116,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_AutoCompose.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_AutoCompose.yaml index 33859e6880f..abda653bb20 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_AutoCompose.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_AutoCompose.yaml @@ -44,10 +44,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -62,6 +58,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -95,8 +95,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -105,12 +107,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -123,6 +119,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Batch_Requests.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Batch_Requests.yaml index 810a35b114c..386b3667796 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Batch_Requests.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Batch_Requests.yaml @@ -42,10 +42,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -60,6 +56,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -120,8 +120,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -130,12 +132,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -148,6 +144,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserById.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserById.yaml index 4217a5484b3..3e0888e00f2 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserById.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserById.yaml @@ -22,10 +22,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -40,6 +36,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -65,8 +65,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -75,12 +77,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -93,6 +89,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserById_With_Invalid_Id_Value.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserById_With_Invalid_Id_Value.yaml index 322e5096eb6..9530bebe0b6 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserById_With_Invalid_Id_Value.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserById_With_Invalid_Id_Value.yaml @@ -22,10 +22,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -40,6 +36,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -65,8 +65,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -75,12 +77,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -93,6 +89,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserReviews.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserReviews.yaml index f4d826122ba..8d0473a10e7 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserReviews.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserReviews.yaml @@ -96,10 +96,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -114,6 +110,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -276,8 +276,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -286,12 +288,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -304,6 +300,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserReviews_Skip_Author.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserReviews_Skip_Author.yaml index ef16399eb40..4cd0d75ea2f 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserReviews_Skip_Author.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserReviews_Skip_Author.yaml @@ -74,10 +74,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -92,6 +88,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -129,8 +129,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -139,12 +141,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -157,6 +153,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserReviews_Skip_Author_ErrorField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserReviews_Skip_Author_ErrorField.yaml index ef500a96ab7..1d0b614c58a 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserReviews_Skip_Author_ErrorField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_GetUserReviews_Skip_Author_ErrorField.yaml @@ -111,10 +111,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -129,6 +125,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -301,8 +301,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -311,12 +313,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -329,6 +325,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_ReviewsUser.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_ReviewsUser.yaml index 1448cfa481d..e3b78f7b4df 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_ReviewsUser.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Authors_And_Reviews_Query_ReviewsUser.yaml @@ -148,10 +148,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -166,6 +162,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -364,8 +364,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -374,12 +376,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -392,6 +388,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values.yaml index 30085e62076..806fb69e2d5 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values.yaml @@ -66,10 +66,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -79,6 +75,10 @@ sourceSchemas: id: ID! displayName: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -139,10 +139,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -153,6 +149,10 @@ sourceSchemas: relativeUrl: String! id: ID! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -231,8 +231,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } type FeedbacksConnection { @@ -243,11 +244,6 @@ sourceSchemas: node: ResaleFeedback! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - } - type ResaleFeedback implements Node { feedback: ResaleSurveyFeedback id: ID! @@ -261,6 +257,10 @@ sourceSchemas: id: ID! feedbacks: FeedbacksConnection } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_And_Forwarded_Variable.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_And_Forwarded_Variable.yaml index 461b1f78d71..af098c28054 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_And_Forwarded_Variable.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_And_Forwarded_Variable.yaml @@ -71,10 +71,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -84,6 +80,10 @@ sourceSchemas: id: ID! displayName(arg: String): String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -147,10 +147,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -161,6 +157,10 @@ sourceSchemas: relativeUrl(arg: String): String! id: ID! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -242,8 +242,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } type FeedbacksConnection { @@ -254,11 +255,6 @@ sourceSchemas: node: ResaleFeedback! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - } - type ResaleFeedback implements Node { feedback: ResaleSurveyFeedback id: ID! @@ -272,6 +268,10 @@ sourceSchemas: id: ID! feedbacks: FeedbacksConnection } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_Some_Items_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_Some_Items_Null.yaml index 02aca0d40a7..4526f8e9666 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_Some_Items_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_Some_Items_Null.yaml @@ -66,10 +66,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -79,6 +75,10 @@ sourceSchemas: id: ID! displayName: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -139,10 +139,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @null(atIndex: 1) @shareable @@ -153,6 +149,10 @@ sourceSchemas: relativeUrl: String! id: ID! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -231,8 +231,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } type FeedbacksConnection { @@ -243,11 +244,6 @@ sourceSchemas: node: ResaleFeedback! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - } - type ResaleFeedback implements Node { feedback: ResaleSurveyFeedback id: ID! @@ -261,6 +257,10 @@ sourceSchemas: id: ID! feedbacks: FeedbacksConnection } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Invalid_Node_Field.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Invalid_Node_Field.yaml index a9bd7766cd4..4e346bf3650 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Invalid_Node_Field.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Invalid_Node_Field.yaml @@ -26,10 +26,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -44,14 +40,20 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } - name: B schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -60,12 +62,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -78,14 +74,21 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } - name: C schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -97,13 +100,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -112,6 +108,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field.yaml index 16f70b6de27..9e8f4954cdd 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field.yaml @@ -28,10 +28,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -46,6 +42,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -80,8 +80,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -90,12 +92,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -108,14 +104,21 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } - name: C schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -127,13 +130,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -142,6 +138,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field_From_Two_Subgraphs.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field_From_Two_Subgraphs.yaml index ca8a70fdfa8..ee1b52abd8d 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field_From_Two_Subgraphs.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field_From_Two_Subgraphs.yaml @@ -42,10 +42,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -60,6 +56,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -93,8 +93,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -103,12 +105,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -121,6 +117,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -169,8 +169,11 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -182,13 +185,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -197,6 +193,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field_Pass_In_Review_Id.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field_Pass_In_Review_Id.yaml index 3d63bf2cbd5..dfdcc048432 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field_Pass_In_Review_Id.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field_Pass_In_Review_Id.yaml @@ -26,10 +26,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -44,14 +40,20 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } - name: B schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -60,12 +62,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -78,6 +74,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -107,8 +107,11 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -120,13 +123,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -135,6 +131,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field_Pass_In_Unknown_Id.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field_Pass_In_Unknown_Id.yaml index bef824b7710..685e4d30186 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field_Pass_In_Unknown_Id.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Fetch_User_With_Node_Field_Pass_In_Unknown_Id.yaml @@ -37,10 +37,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -55,14 +51,20 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } - name: B schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -71,12 +73,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -89,14 +85,21 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } - name: C schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -108,13 +111,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -123,6 +119,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node.yaml index 988c6d99382..da7a40bdd3b 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node.yaml @@ -34,8 +34,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + productById(id: ID!): Product @lookup + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } type Product implements Node { @@ -52,10 +54,8 @@ sourceSchemas: subgraph1Only: String! } - type Query { - node(id: ID!): Node @lookup @shareable - productById(id: ID!): Product @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable + interface Node { + id: ID! } interactions: - request: @@ -96,8 +96,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node("ID of the object." id: ID!): Node @lookup @shareable + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } type ProductAvailability implements Node { @@ -109,9 +110,8 @@ sourceSchemas: subgraph2Only: Boolean! } - type Query { - node("ID of the object." id: ID!): Node @lookup @shareable - productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_2.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_2.yaml index a7ef1bbaa66..6c4ec38365e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_2.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_2.yaml @@ -38,8 +38,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + productById(id: ID!): Product @lookup + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } type Product implements Node { @@ -56,10 +58,8 @@ sourceSchemas: sharedScalar: String! @shareable } - type Query { - node(id: ID!): Node @lookup @shareable - productById(id: ID!): Product @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable + interface Node { + id: ID! } interactions: - request: @@ -100,8 +100,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } type ProductAvailability implements Node { @@ -115,9 +116,8 @@ sourceSchemas: sharedScalar: String! @shareable } - type Query { - node(id: ID!): Node @lookup @shareable - productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_3.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_3.yaml index 4653c517c3c..5057a7bb588 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_3.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_3.yaml @@ -42,8 +42,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + productById(id: ID!): Product @lookup + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } type Product implements Node { @@ -62,10 +64,8 @@ sourceSchemas: subgraph1Only: String! } - type Query { - node(id: ID!): Node @lookup @shareable - productById(id: ID!): Product @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable + interface Node { + id: ID! } interactions: - request: @@ -110,8 +110,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } type ProductAvailability implements Node { @@ -125,9 +126,8 @@ sourceSchemas: sharedScalar: String! @shareable } - type Query { - node(id: ID!): Node @lookup @shareable - productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Node_Variables.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Node_Variables.yaml index 1249f0d5b33..8a5bdbfa422 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Node_Variables.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Node_Variables.yaml @@ -31,10 +31,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -49,14 +45,20 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } - name: B schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -65,12 +67,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -83,14 +79,21 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } - name: C schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -102,13 +105,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -117,6 +113,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Object_Variables.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Object_Variables.yaml index f60ebb43d1b..735deed3609 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Object_Variables.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Object_Variables.yaml @@ -37,10 +37,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -55,14 +51,20 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } - name: B schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -71,12 +73,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -89,14 +85,21 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } - name: C schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -108,13 +111,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -123,6 +119,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Variables.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Variables.yaml index 50e77710a73..1c48fee6171 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Variables.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Variables.yaml @@ -29,10 +29,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -47,14 +43,20 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } - name: B schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -63,12 +65,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -81,14 +77,21 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } - name: C schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -100,13 +103,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -115,6 +111,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Variables_No_OpName.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Variables_No_OpName.yaml index 529d55063b4..c7c58e2e908 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Variables_No_OpName.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Variables_No_OpName.yaml @@ -29,10 +29,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -47,14 +43,20 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } - name: B schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -63,12 +65,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -81,14 +77,21 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } - name: C schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -100,13 +103,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -115,6 +111,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Variables_No_OpName_Two_RootSelections.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Variables_No_OpName_Two_RootSelections.yaml index 4c6244bf365..bb3b1d766fc 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Variables_No_OpName_Two_RootSelections.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Forward_Nested_Variables_No_OpName_Two_RootSelections.yaml @@ -37,10 +37,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -55,14 +51,20 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } - name: B schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -71,12 +73,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -89,14 +85,21 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } - name: C schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -108,13 +111,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -123,6 +119,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.GetFirstPage_With_After_Null.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.GetFirstPage_With_After_Null.yaml index dd5d2774e7e..413ace22292 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.GetFirstPage_With_After_Null.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.GetFirstPage_With_After_Null.yaml @@ -38,6 +38,10 @@ sourceSchemas: query: Query } + type Query { + appointments(after: String): AppointmentConnection + } + type Appointment { id: ID! } @@ -45,10 +49,6 @@ sourceSchemas: type AppointmentConnection { nodes: [Appointment!] } - - type Query { - appointments(after: String): AppointmentConnection - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.QueryType_Parallel_Multiple_SubGraphs_WithArguments.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.QueryType_Parallel_Multiple_SubGraphs_WithArguments.yaml index d21e20ed71f..cee25fa91a9 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.QueryType_Parallel_Multiple_SubGraphs_WithArguments.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.QueryType_Parallel_Multiple_SubGraphs_WithArguments.yaml @@ -82,10 +82,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -100,14 +96,20 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } - name: B schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -116,12 +118,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -134,6 +130,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -226,8 +226,11 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -239,13 +242,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -254,6 +250,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } @@ -298,8 +298,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } type DeliveryEstimate { @@ -314,9 +315,8 @@ sourceSchemas: deliveryEstimate(size: Int, weight: Int, zip: String!): DeliveryEstimate! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Require_Data_In_Context.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Require_Data_In_Context.yaml index ba5155000eb..5296f5c0af1 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Require_Data_In_Context.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Require_Data_In_Context.yaml @@ -74,10 +74,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -92,6 +88,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -156,8 +156,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -166,12 +168,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -184,6 +180,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -241,8 +241,11 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -254,13 +257,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -269,6 +265,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } @@ -330,8 +330,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } type DeliveryEstimate { @@ -346,9 +347,8 @@ sourceSchemas: deliveryEstimate(size: Int, weight: Int, zip: String!): DeliveryEstimate! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Require_Data_In_Context_2.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Require_Data_In_Context_2.yaml index e256909ded1..493936db4bf 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Require_Data_In_Context_2.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Require_Data_In_Context_2.yaml @@ -70,10 +70,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -88,6 +84,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -152,8 +152,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -162,12 +164,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -180,6 +176,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -237,8 +237,11 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -250,13 +253,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -265,6 +261,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } @@ -278,8 +278,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } type DeliveryEstimate { @@ -294,9 +295,8 @@ sourceSchemas: deliveryEstimate(size: Int, weight: Int, zip: String!): DeliveryEstimate! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Require_Data_In_Context_3.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Require_Data_In_Context_3.yaml index 1f465704110..5dff356041d 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Require_Data_In_Context_3.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Require_Data_In_Context_3.yaml @@ -184,10 +184,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -202,6 +198,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -378,8 +378,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -388,12 +390,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -406,6 +402,10 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } interactions: - request: accept: application/jsonl; charset=utf-8, text/event-stream; charset=utf-8, application/graphql-response+json; charset=utf-8, application/json; charset=utf-8 @@ -558,8 +558,11 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -571,13 +574,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -586,6 +582,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } @@ -713,8 +713,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } type DeliveryEstimate { @@ -729,9 +730,8 @@ sourceSchemas: deliveryEstimate(size: Int, weight: Int, zip: String!): DeliveryEstimate! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Same_Selection_On_Two_List_Fields_That_Require_Data_From_Another_Subgraph.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Same_Selection_On_Two_List_Fields_That_Require_Data_From_Another_Subgraph.yaml index 2ede2de2e18..4903634da1e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Same_Selection_On_Two_List_Fields_That_Require_Data_From_Another_Subgraph.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Same_Selection_On_Two_List_Fields_That_Require_Data_From_Another_Subgraph.yaml @@ -68,8 +68,10 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + productsA: [Product] + productsB: [Product] + productById(id: ID!): Product @lookup @internal } type Product implements Node { @@ -77,10 +79,8 @@ sourceSchemas: name: String! } - type Query { - productsA: [Product] - productsB: [Product] - productById(id: ID!): Product @lookup @internal + interface Node { + id: ID! } interactions: - request: @@ -137,8 +137,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup + nodes(ids: [ID!]!): [Node]! } type Product implements Node { @@ -147,9 +148,8 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Same_Selection_On_Two_Object_Types_That_Require_Data_From_Another_Subgraph.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Same_Selection_On_Two_Object_Types_That_Require_Data_From_Another_Subgraph.yaml index 8a9fa04cbe6..4dee4fdc874 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Same_Selection_On_Two_Object_Types_That_Require_Data_From_Another_Subgraph.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Same_Selection_On_Two_Object_Types_That_Require_Data_From_Another_Subgraph.yaml @@ -40,8 +40,9 @@ sourceSchemas: query: Query } - interface Node @key(fields: "id") { - id: ID! + type Query { + item1: Item1! + item2: Item2! } type Item1 { @@ -56,9 +57,8 @@ sourceSchemas: id: ID! } - type Query { - item1: Item1! - item2: Item2! + interface Node @key(fields: "id") { + id: ID! } interactions: - request: @@ -99,8 +99,9 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup + nodes(ids: [ID!]!): [Node]! } type Product implements Node { @@ -108,9 +109,8 @@ sourceSchemas: name: String! } - type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Subgraph_Containing_More_Selections_Is_Chosen.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Subgraph_Containing_More_Selections_Is_Chosen.yaml index 7d0af59d5fe..06102e32bd9 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Subgraph_Containing_More_Selections_Is_Chosen.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Subgraph_Containing_More_Selections_Is_Chosen.yaml @@ -28,13 +28,13 @@ sourceSchemas: query: Query } - type Product @key(fields: "id") { - id: ID! - } - type Query { productBySlug: Product } + + type Product @key(fields: "id") { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -60,6 +60,10 @@ sourceSchemas: query: Query } + type Query { + productById(id: ID!): Product @lookup @shareable + } + type Author { name: String! @shareable } @@ -68,16 +72,16 @@ sourceSchemas: id: ID! author: Author @shareable } - - type Query { - productById(id: ID!): Product @lookup @shareable - } - name: C schema: | schema { query: Query } + type Query { + productById(id: ID!): Product @lookup @shareable + } + type Author { name: String! @shareable rating: Int! @@ -87,10 +91,6 @@ sourceSchemas: id: ID! author: Author @shareable } - - type Query { - productById(id: ID!): Product @lookup @shareable - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Two_Arguments_Differing_Nullability_Does_Not_Duplicate_Forwarded_Variables.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Two_Arguments_Differing_Nullability_Does_Not_Duplicate_Forwarded_Variables.yaml index 53a53df5ce7..dd30f1d2274 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Two_Arguments_Differing_Nullability_Does_Not_Duplicate_Forwarded_Variables.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Two_Arguments_Differing_Nullability_Does_Not_Duplicate_Forwarded_Variables.yaml @@ -22,10 +22,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -40,6 +36,10 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.TypeName_Field_On_QueryRoot.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.TypeName_Field_On_QueryRoot.yaml index bb79f2883a5..d6e806fdc59 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.TypeName_Field_On_QueryRoot.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.TypeName_Field_On_QueryRoot.yaml @@ -18,10 +18,6 @@ sourceSchemas: query: Query } - interface Node { - id: ID! - } - type Query { node(id: ID!): Node @lookup @shareable nodes(ids: [ID!]!): [Node]! @shareable @@ -36,14 +32,20 @@ sourceSchemas: username: String! birthdate: String! } + + interface Node { + id: ID! + } - name: B schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + reviews: [Review!]! } type Product implements Node { @@ -52,12 +54,6 @@ sourceSchemas: reviewCount: Int! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - reviews: [Review!]! - } - type Review implements Node { id: ID! body: String! @@ -70,14 +66,21 @@ sourceSchemas: reviews: [Review!]! errorField: String @error } + + interface Node { + id: ID! + } - name: C schema: | schema { query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + productById(id: ID!): Product @lookup @shareable + topProducts(first: Int!): [Product!]! } type Product implements Node { @@ -89,13 +92,6 @@ sourceSchemas: repeatData(data: RepeatDataInput!): RepeatDataPayload! } - type Query { - node(id: ID!): Node @lookup @shareable - nodes(ids: [ID!]!): [Node]! @shareable - productById(id: ID!): Product @lookup @shareable - topProducts(first: Int!): [Product!]! - } - type RepeatDataData { num: Int! } @@ -104,6 +100,10 @@ sourceSchemas: data: RepeatDataData! } + interface Node { + id: ID! + } + input RepeatDataDataInput { num: Int! } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Unresolvable_Subgraph_Is_Not_Chosen_If_Data_Is_Available_In_Resolvable_Subgraph.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Unresolvable_Subgraph_Is_Not_Chosen_If_Data_Is_Available_In_Resolvable_Subgraph.yaml index ba732abd3db..b9dce666208 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Unresolvable_Subgraph_Is_Not_Chosen_If_Data_Is_Available_In_Resolvable_Subgraph.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Unresolvable_Subgraph_Is_Not_Chosen_If_Data_Is_Available_In_Resolvable_Subgraph.yaml @@ -28,21 +28,21 @@ sourceSchemas: query: Query } - interface Node @key(fields: "id") { - id: ID! + type Query { + viewer: Viewer } type Product implements Node { id: ID! } - type Query { - viewer: Viewer - } - type Viewer { product: Product! } + + interface Node @key(fields: "id") { + id: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -72,15 +72,15 @@ sourceSchemas: query: Query } + type Query { + test: Test! + } + type Product @key(fields: "id") { id: ID! name: String! @shareable } - type Query { - test: Test! - } - type Test { id: ID! } @@ -90,8 +90,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup } type Product implements Node { @@ -99,8 +99,8 @@ sourceSchemas: name: String! @shareable } - type Query { - node(id: ID!): Node @lookup + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_1.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_1.yaml index 39664ecdaa8..481479a1459 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_1.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_1.yaml @@ -28,15 +28,15 @@ sourceSchemas: query: Query } - type ExclusiveSubgraphA { - id: ID! - } - type Query { exclusiveSubgraphA: ExclusiveSubgraphA viewer: Viewer @shareable } + type ExclusiveSubgraphA { + id: ID! + } + type Viewer { name: String } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_2.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_2.yaml index 341d02c24a6..ee900774dfb 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_2.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_2.yaml @@ -32,15 +32,15 @@ sourceSchemas: query: Query } - type ExclusiveSubgraphA { - id: ID! - } - type Query { exclusiveSubgraphA: ExclusiveSubgraphA viewer: Viewer @shareable } + type ExclusiveSubgraphA { + id: ID! + } + type SubType { subgraphA: String } diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_EntryField_NonNull_One_Service_Errors_EntryField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_EntryField_NonNull_One_Service_Errors_EntryField.yaml index 749d92ff903..de09b8526da 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_EntryField_NonNull_One_Service_Errors_EntryField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_EntryField_NonNull_One_Service_Errors_EntryField.yaml @@ -51,13 +51,13 @@ sourceSchemas: query: Query } - type Other { - userId: ID! - } - type Query { other: Other! @error } + + type Other { + userId: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_EntryField_Nullable_One_Service_Errors_EntryField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_EntryField_Nullable_One_Service_Errors_EntryField.yaml index a9616f8e2bd..24d99987000 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_EntryField_Nullable_One_Service_Errors_EntryField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_EntryField_Nullable_One_Service_Errors_EntryField.yaml @@ -66,13 +66,13 @@ sourceSchemas: query: Query } - type Other { - userId: ID! - } - type Query { other: Other @error } + + type Other { + userId: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_SubField_NonNull_EntryField_NonNull_One_Service_Errors_SubField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_SubField_NonNull_EntryField_NonNull_One_Service_Errors_SubField.yaml index 9ce224aad7b..ced77d0c17d 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_SubField_NonNull_EntryField_NonNull_One_Service_Errors_SubField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_SubField_NonNull_EntryField_NonNull_One_Service_Errors_SubField.yaml @@ -51,13 +51,13 @@ sourceSchemas: query: Query } - type Other { - userId: ID! @error - } - type Query { other: Other! } + + type Other { + userId: ID! @error + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_SubField_NonNull_EntryField_Nullable_One_Service_Errors_SubField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_SubField_NonNull_EntryField_Nullable_One_Service_Errors_SubField.yaml index 901bd0a016a..10728bdf0c1 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_SubField_NonNull_EntryField_Nullable_One_Service_Errors_SubField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_SubField_NonNull_EntryField_Nullable_One_Service_Errors_SubField.yaml @@ -66,13 +66,13 @@ sourceSchemas: query: Query } - type Other { - userId: ID! @error - } - type Query { other: Other } + + type Other { + userId: ID! @error + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_SubField_Nullable_EntryField_Nullable_One_Service_Errors_SubField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_SubField_Nullable_EntryField_Nullable_One_Service_Errors_SubField.yaml index a64008cae99..cc4e4e5a567 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_SubField_Nullable_EntryField_Nullable_One_Service_Errors_SubField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Parallel_SubField_Nullable_EntryField_Nullable_One_Service_Errors_SubField.yaml @@ -69,13 +69,13 @@ sourceSchemas: query: Query } - type Other { - userId: ID @error - } - type Query { other: Other } + + type Other { + userId: ID @error + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_EntryField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_EntryField.yaml index 76184a320a3..3e7143fdbb2 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_EntryField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_EntryField.yaml @@ -34,6 +34,10 @@ sourceSchemas: query: Query } + type Query { + product: Product + } + type Brand @key(fields: "id") { id: ID! } @@ -42,10 +46,6 @@ sourceSchemas: id: ID! brand: Brand! } - - type Query { - product: Product - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -77,14 +77,14 @@ sourceSchemas: query: Query } + type Query { + brandById(id: ID!): Brand @lookup @error + } + type Brand { id: ID! name: String! } - - type Query { - brandById(id: ID!): Brand @lookup @error - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_SubField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_SubField.yaml index 7755f72ef6f..355dfa16400 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_SubField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_SubField.yaml @@ -34,6 +34,10 @@ sourceSchemas: query: Query } + type Query { + product: Product + } + type Brand @key(fields: "id") { id: ID! } @@ -42,10 +46,6 @@ sourceSchemas: id: ID! brand: Brand! } - - type Query { - product: Product - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -77,14 +77,14 @@ sourceSchemas: query: Query } + type Query { + brandById(id: ID!): Brand @lookup + } + type Brand { id: ID! name: String! @error } - - type Query { - brandById(id: ID!): Brand @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_EntryField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_EntryField.yaml index ab5690b19ff..555f45451de 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_EntryField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_EntryField.yaml @@ -37,6 +37,10 @@ sourceSchemas: query: Query } + type Query { + product: Product + } + type Brand @key(fields: "id") { id: ID! } @@ -45,10 +49,6 @@ sourceSchemas: id: ID! brand: Brand } - - type Query { - product: Product - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -80,14 +80,14 @@ sourceSchemas: query: Query } + type Query { + brandById(id: ID!): Brand @lookup @error + } + type Brand { id: ID! name: String! } - - type Query { - brandById(id: ID!): Brand @lookup @error - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_SubField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_SubField.yaml index 09e10409f91..819b30620ef 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_SubField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_SubField.yaml @@ -37,6 +37,10 @@ sourceSchemas: query: Query } + type Query { + product: Product + } + type Brand @key(fields: "id") { id: ID! } @@ -45,10 +49,6 @@ sourceSchemas: id: ID! brand: Brand } - - type Query { - product: Product - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -80,14 +80,14 @@ sourceSchemas: query: Query } + type Query { + brandById(id: ID!): Brand @lookup + } + type Brand { id: ID! name: String! @error } - - type Query { - brandById(id: ID!): Brand @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_EntryField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_EntryField.yaml index e7e71781f1e..30a9ccf6eb0 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_EntryField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_EntryField.yaml @@ -40,6 +40,10 @@ sourceSchemas: query: Query } + type Query { + product: Product + } + type Brand @key(fields: "id") { id: ID! } @@ -48,10 +52,6 @@ sourceSchemas: id: ID! brand: Brand } - - type Query { - product: Product - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -83,14 +83,14 @@ sourceSchemas: query: Query } + type Query { + brandById(id: ID!): Brand @lookup @error + } + type Brand { id: ID! name: String } - - type Query { - brandById(id: ID!): Brand @lookup @error - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_SubField.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_SubField.yaml index cdbdf6d5543..631c5b4d792 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_SubField.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_SubField.yaml @@ -40,6 +40,10 @@ sourceSchemas: query: Query } + type Query { + product: Product + } + type Brand @key(fields: "id") { id: ID! } @@ -48,10 +52,6 @@ sourceSchemas: id: ID! brand: Brand } - - type Query { - product: Product - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -83,14 +83,14 @@ sourceSchemas: query: Query } + type Query { + brandById(id: ID!): Brand @lookup + } + type Brand { id: ID! name: String @error } - - type Query { - brandById(id: ID!): Brand @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Node_Service_Offline_EntryField_Nullable.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Node_Service_Offline_EntryField_Nullable.yaml index 28ca878e291..ad246448e6c 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Node_Service_Offline_EntryField_Nullable.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Node_Service_Offline_EntryField_Nullable.yaml @@ -31,8 +31,8 @@ sourceSchemas: query: Query } - interface Node { - id: ID! + type Query { + node(id: ID!): Node @lookup } type Brand implements Node { @@ -40,8 +40,8 @@ sourceSchemas: name: String } - type Query { - node(id: ID!): Node @lookup + interface Node { + id: ID! } interactions: - request: diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Parallel_One_Service_Offline_EntryFields_NonNull.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Parallel_One_Service_Offline_EntryFields_NonNull.yaml index ed909e89e2f..c4f3e5dbdd2 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Parallel_One_Service_Offline_EntryFields_NonNull.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Parallel_One_Service_Offline_EntryFields_NonNull.yaml @@ -52,13 +52,13 @@ sourceSchemas: query: Query } - type Other { - userId: ID! - } - type Query { other: Other! } + + type Other { + userId: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Parallel_One_Service_Offline_EntryFields_Nullable.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Parallel_One_Service_Offline_EntryFields_Nullable.yaml index 6e565dfe14a..fd989821da3 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Parallel_One_Service_Offline_EntryFields_Nullable.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Parallel_One_Service_Offline_EntryFields_Nullable.yaml @@ -58,13 +58,13 @@ sourceSchemas: query: Query } - type Other { - userId: ID! - } - type Query { other: Other } + + type Other { + userId: ID! + } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_NonNull.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_NonNull.yaml index 02ed8878fd8..dc2bef0df8f 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_NonNull.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_NonNull.yaml @@ -29,6 +29,10 @@ sourceSchemas: query: Query } + type Query { + product: Product! + } + type Brand @key(fields: "id") { id: ID! } @@ -37,10 +41,6 @@ sourceSchemas: id: ID! brand: Brand! } - - type Query { - product: Product! - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -61,14 +61,14 @@ sourceSchemas: query: Query } + type Query { + brandById(id: ID!): Brand @lookup + } + type Brand { id: ID! name: String! } - - type Query { - brandById(id: ID!): Brand @lookup - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_Nullable.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_Nullable.yaml index 06c99b373cb..0636f860af0 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_Nullable.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_Nullable.yaml @@ -32,6 +32,10 @@ sourceSchemas: query: Query } + type Query { + product: Product + } + type Brand @key(fields: "id") { id: ID! } @@ -40,10 +44,6 @@ sourceSchemas: id: ID! brand: Brand! } - - type Query { - product: Product - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -64,14 +64,14 @@ sourceSchemas: query: Query } + type Query { + brandById(id: ID!): Brand @lookup + } + type Brand { id: ID! name: String! } - - type Query { - brandById(id: ID!): Brand @lookup - } operationPlan: operation: - document: | diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_NonNull.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_NonNull.yaml index ac37031939b..e878d40bfea 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_NonNull.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_NonNull.yaml @@ -34,6 +34,10 @@ sourceSchemas: query: Query } + type Query { + product: Product + } + type Brand @key(fields: "id") { id: ID! } @@ -42,10 +46,6 @@ sourceSchemas: id: ID! brand: Brand! } - - type Query { - product: Product - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -77,14 +77,14 @@ sourceSchemas: query: Query } + type Query { + brandById(id: ID!): Brand @lookup + } + type Brand { id: ID! name: String! } - - type Query { - brandById(id: ID!): Brand @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_Nullable.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_Nullable.yaml index 6d09c7aaf7a..bdfd05cc739 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_Nullable.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_Nullable.yaml @@ -37,6 +37,10 @@ sourceSchemas: query: Query } + type Query { + product: Product + } + type Brand @key(fields: "id") { id: ID! } @@ -45,10 +49,6 @@ sourceSchemas: id: ID! brand: Brand } - - type Query { - product: Product - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -80,14 +80,14 @@ sourceSchemas: query: Query } + type Query { + brandById(id: ID!): Brand @lookup + } + type Brand { id: ID! name: String! } - - type Query { - brandById(id: ID!): Brand @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_Nullable_Parent_Nullable.yaml b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_Nullable_Parent_Nullable.yaml index 32ffd9c9b54..abd35fee839 100644 --- a/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_Nullable_Parent_Nullable.yaml +++ b/src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_Nullable_Parent_Nullable.yaml @@ -40,6 +40,10 @@ sourceSchemas: query: Query } + type Query { + product: Product + } + type Brand @key(fields: "id") { id: ID! } @@ -48,10 +52,6 @@ sourceSchemas: id: ID! brand: Brand } - - type Query { - product: Product - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 @@ -83,14 +83,14 @@ sourceSchemas: query: Query } + type Query { + brandById(id: ID!): Brand @lookup + } + type Brand { id: ID! name: String } - - type Query { - brandById(id: ID!): Brand @lookup - } interactions: - request: accept: application/graphql-response+json; charset=utf-8, application/json; charset=utf-8, application/jsonl; charset=utf-8, text/event-stream; charset=utf-8 diff --git a/src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SourceSchemaMergerTestBase.cs b/src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SourceSchemaMergerTestBase.cs index 55b34a73b07..d20909d3439 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SourceSchemaMergerTestBase.cs +++ b/src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SourceSchemaMergerTestBase.cs @@ -1,5 +1,6 @@ using System.Diagnostics.CodeAnalysis; using HotChocolate.Fusion.Options; +using HotChocolate.Serialization; using HotChocolate.Types.Mutable; using HotChocolate.Types.Mutable.Serialization; using static HotChocolate.Fusion.CompositionTestHelper; diff --git a/src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SourceSchemaMergerTests.cs b/src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SourceSchemaMergerTests.cs index 928530b68a9..3b1c69258a5 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SourceSchemaMergerTests.cs +++ b/src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SourceSchemaMergerTests.cs @@ -2,6 +2,7 @@ using HotChocolate.Fusion.Comparers; using HotChocolate.Fusion.Logging; using HotChocolate.Fusion.Options; +using HotChocolate.Serialization; using HotChocolate.Types.Mutable; using HotChocolate.Types.Mutable.Serialization; using static HotChocolate.Fusion.CompositionTestHelper; diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation.graphql b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation.graphql index 0f9b68aef64..fd29bf068f3 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation.graphql +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation.graphql @@ -139,12 +139,6 @@ input FooFilterInput { barDateTime: ComparableDateTimeOperationFilterInput } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `DateTime` scalar type represents a date and time with time zone offset information." scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation_Normalized.graphql b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation_Normalized.graphql index d0d96788d0f..66e452f649f 100644 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation_Normalized.graphql +++ b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/__snapshots__/MongoDbFilterVisitorComparableTests.Create_Implicit_Operation_Normalized.graphql @@ -124,12 +124,6 @@ input UuidOperationFilterInput { nlte: UUID } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "The `DateTime` scalar type represents a date and time with time zone offset information." scalar DateTime @specifiedBy(url: "https://scalars.graphql.org/chillicream/date-time.html") diff --git a/src/HotChocolate/MongoDb/test/Types.MongoDb/__snapshots__/BsonTypeTests.Output_Should_BindAllRuntimeTypes.graphql b/src/HotChocolate/MongoDb/test/Types.MongoDb/__snapshots__/BsonTypeTests.Output_Should_BindAllRuntimeTypes.graphql index b5a06014a8a..1b4aa52de8a 100644 --- a/src/HotChocolate/MongoDb/test/Types.MongoDb/__snapshots__/BsonTypeTests.Output_Should_BindAllRuntimeTypes.graphql +++ b/src/HotChocolate/MongoDb/test/Types.MongoDb/__snapshots__/BsonTypeTests.Output_Should_BindAllRuntimeTypes.graphql @@ -18,11 +18,5 @@ type OutputQuery { document: Bson! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR - "BSON is a binary format in which zero or more ordered key/value pairs are stored as a single entity. The results are returned as JSON objects" scalar Bson @specifiedBy(url: "https://bsonspec.org/spec.html") diff --git a/src/HotChocolate/MongoDb/test/Types.MongoDb/__snapshots__/ObjectIdTypeTests.Should_MapObjectIdToScalar.snap b/src/HotChocolate/MongoDb/test/Types.MongoDb/__snapshots__/ObjectIdTypeTests.Should_MapObjectIdToScalar.snap index 6317522a31e..05e617fa59c 100644 --- a/src/HotChocolate/MongoDb/test/Types.MongoDb/__snapshots__/ObjectIdTypeTests.Should_MapObjectIdToScalar.snap +++ b/src/HotChocolate/MongoDb/test/Types.MongoDb/__snapshots__/ObjectIdTypeTests.Should_MapObjectIdToScalar.snap @@ -2,20 +2,14 @@ schema { query: Query } -type Foo { - id: ObjectId! -} - type Query { foo: Foo! loopback(objectId: ObjectId!): ObjectId! } -"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions." -directive @specifiedBy( - "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." - url: String! -) on SCALAR +type Foo { + id: ObjectId! +} "The ObjectId scalar type represents a 12 byte ObjectId, represented as UTF-8 character sequences." scalar ObjectId diff --git a/src/HotChocolate/Mutable/src/Types.Mutable/Extensions/FeatureCollectionExtensions.cs b/src/HotChocolate/Mutable/src/Types.Mutable/Extensions/FeatureCollectionExtensions.cs index 1bbc1e9e07d..273eb1e9ee0 100644 --- a/src/HotChocolate/Mutable/src/Types.Mutable/Extensions/FeatureCollectionExtensions.cs +++ b/src/HotChocolate/Mutable/src/Types.Mutable/Extensions/FeatureCollectionExtensions.cs @@ -4,17 +4,12 @@ namespace HotChocolate.Types.Mutable; public static class FeatureCollectionExtensions { - public static TypeMetadata GetTypeMetadata(this T type) + /// + /// Marks a type definition as a type extension by setting the + /// feature, which is consumed by + /// the canonical SDL formatter to emit the type using extend syntax. + /// + public static void MarkAsExtension(this T type) where T : ITypeDefinition, IFeatureProvider - { - var metadata = type.Features.Get(); - - if (metadata is null) - { - metadata = new TypeMetadata(); - type.Features.Set(metadata); - } - - return metadata; - } + => type.Features.Set(TypeExtensionMarker.Instance); } diff --git a/src/HotChocolate/Mutable/src/Types.Mutable/Extensions/TypeExtensions.cs b/src/HotChocolate/Mutable/src/Types.Mutable/Extensions/TypeExtensions.cs index 3108335dc34..18965e4ec78 100644 --- a/src/HotChocolate/Mutable/src/Types.Mutable/Extensions/TypeExtensions.cs +++ b/src/HotChocolate/Mutable/src/Types.Mutable/Extensions/TypeExtensions.cs @@ -7,5 +7,5 @@ public static class TypeExtensions { public static bool IsTypeExtension(this IType type) => type is IFeatureProvider featureProvider - && featureProvider.Features.Get() is { IsExtension: true }; + && featureProvider.Features.Get() is not null; } diff --git a/src/HotChocolate/Mutable/src/Types.Mutable/MutableDirectiveDefinition.cs b/src/HotChocolate/Mutable/src/Types.Mutable/MutableDirectiveDefinition.cs index 2d1623a3aeb..14d01d118a1 100644 --- a/src/HotChocolate/Mutable/src/Types.Mutable/MutableDirectiveDefinition.cs +++ b/src/HotChocolate/Mutable/src/Types.Mutable/MutableDirectiveDefinition.cs @@ -54,6 +54,13 @@ public string Name /// public bool IsRepeatable { get; set; } + /// + /// Defines if this directive is publicly visible through introspection + /// and external SDL output. Internal directives are part of the type system + /// but hidden from external observers. + /// + public bool IsPublic { get; set; } = true; + /// /// Gets the arguments that are defined on this directive. /// diff --git a/src/HotChocolate/Mutable/src/Types.Mutable/MutableSchemaDefinition.cs b/src/HotChocolate/Mutable/src/Types.Mutable/MutableSchemaDefinition.cs index 9e7bcc2582d..d0da29e2c4f 100644 --- a/src/HotChocolate/Mutable/src/Types.Mutable/MutableSchemaDefinition.cs +++ b/src/HotChocolate/Mutable/src/Types.Mutable/MutableSchemaDefinition.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; using HotChocolate.Features; using HotChocolate.Language; -using HotChocolate.Types.Mutable.Serialization; +using HotChocolate.Serialization; namespace HotChocolate.Types.Mutable; @@ -346,18 +346,6 @@ public IEnumerable GetAllDefinitions() public override string ToString() => SchemaFormatter.FormatAsString(this); - /// - /// Returns a string representation of the schema. - /// - /// - /// The options that control the formatting of the schema document. - /// - /// - /// A string representation of the schema. - /// - public string ToString(SchemaFormatterOptions options) - => SchemaFormatter.FormatAsString(this, options); - /// /// Returns a syntax node representation of the schema. /// @@ -365,19 +353,7 @@ public string ToString(SchemaFormatterOptions options) /// A syntax node representation of the schema. /// public DocumentNode ToSyntaxNode() - => ToSyntaxNode(default); - - /// - /// Returns a syntax node representation of the schema. - /// - /// - /// The options that control the formatting of the schema document. - /// - /// - /// A syntax node representation of the schema. - /// - public DocumentNode ToSyntaxNode(SchemaFormatterOptions options) - => SchemaFormatter.FormatAsDocument(this, options); + => SchemaFormatter.FormatAsDocument(this); ISyntaxNode ISyntaxNodeProvider.ToSyntaxNode() => ToSyntaxNode(); diff --git a/src/HotChocolate/Mutable/src/Types.Mutable/SchemaVisitor.cs b/src/HotChocolate/Mutable/src/Types.Mutable/MutableSchemaDefinitionVisitor.cs similarity index 100% rename from src/HotChocolate/Mutable/src/Types.Mutable/SchemaVisitor.cs rename to src/HotChocolate/Mutable/src/Types.Mutable/MutableSchemaDefinitionVisitor.cs diff --git a/src/HotChocolate/Mutable/src/Types.Mutable/Serialization/SchemaFormatter.cs b/src/HotChocolate/Mutable/src/Types.Mutable/Serialization/SchemaFormatter.cs deleted file mode 100644 index 69e06a41e2c..00000000000 --- a/src/HotChocolate/Mutable/src/Types.Mutable/Serialization/SchemaFormatter.cs +++ /dev/null @@ -1,591 +0,0 @@ -using HotChocolate.Language; -using HotChocolate.Language.Utilities; - -namespace HotChocolate.Types.Mutable.Serialization; - -public static class SchemaFormatter -{ - private static readonly SchemaFormatterVisitor s_visitor = new(); - private static readonly SyntaxSerializerOptions s_options = - new() - { - Indented = true, - PrintWidth = 80 - }; - - public static string FormatAsString(MutableSchemaDefinition schema, SchemaFormatterOptions options = default) - { - var document = FormatAsDocument(schema, options); - - if (options.Indented == false) - { - return document.ToString(false); - } - - return document.ToString(s_options); - } - - public static DocumentNode FormatAsDocument(MutableSchemaDefinition schema, SchemaFormatterOptions options = default) - { - var context = new VisitorContext - { - Schema = schema, - OrderByName = options.OrderByName ?? true, - PrintSpecScalars = options.PrintSpecScalars ?? false, - PrintSpecDirectives = options.PrintSpecDirectives ?? false - }; - s_visitor.VisitSchema(schema, context); - return (DocumentNode)context.Result!; - } - - private sealed class SchemaFormatterVisitor : MutableSchemaDefinitionVisitor - { - public override void VisitSchema(MutableSchemaDefinition schema, VisitorContext context) - { - if (!ReferenceEquals(context.Schema, schema)) - { - throw new InvalidOperationException("The schema must be the same as the schema on the context."); - } - - var definitions = new List(); - - if (schema.QueryType is not null - || schema.MutationType is not null - || schema.SubscriptionType is not null) - { - var operationTypes = new List(); - - if (schema.QueryType is not null) - { - operationTypes.Add( - new OperationTypeDefinitionNode( - null, - OperationType.Query, - new NamedTypeNode(schema.QueryType.Name))); - } - - if (schema.MutationType is not null) - { - operationTypes.Add( - new OperationTypeDefinitionNode( - null, - OperationType.Mutation, - new NamedTypeNode(schema.MutationType.Name))); - } - - if (schema.SubscriptionType is not null) - { - operationTypes.Add( - new OperationTypeDefinitionNode( - null, - OperationType.Subscription, - new NamedTypeNode(schema.SubscriptionType.Name))); - } - - VisitDirectives(schema.Directives, context); - - var schemaDefinition = new SchemaDefinitionNode( - null, - CreateDescription(schema.Description), - (IReadOnlyList)context.Result!, - operationTypes); - definitions.Add(schemaDefinition); - } - - if (context.OrderByName) - { - VisitTypes(schema.Types, context); - definitions.AddRange((List)context.Result!); - - VisitDirectiveDefinitions(schema.DirectiveDefinitions, context); - definitions.AddRange((List)context.Result!); - } - else - { - VisitTypesAndDirectives(schema, context); - definitions.AddRange((List)context.Result!); - } - - context.Result = new DocumentNode(definitions); - } - - private void VisitTypesAndDirectives(MutableSchemaDefinition schema, VisitorContext context) - { - var definitionNodes = new List(); - - foreach (var definition in schema.GetAllDefinitions()) - { - if (definition is MutableDirectiveDefinition directiveDefinition) - { - if (!context.PrintSpecDirectives - && DirectiveNames.IsSpecDirective(directiveDefinition.Name)) - { - continue; - } - - VisitDirectiveDefinition(directiveDefinition, context); - definitionNodes.Add((IDefinitionNode)context.Result!); - } - - if (definition is ITypeDefinition namedTypeDefinition) - { - if (!context.PrintSpecScalars - && namedTypeDefinition is MutableScalarTypeDefinition scalarType - && (scalarType is { IsSpecScalar: true } - || SpecScalarNames.IsSpecScalar(scalarType.Name))) - { - continue; - } - - VisitType(namedTypeDefinition, context); - definitionNodes.Add((IDefinitionNode)context.Result!); - } - } - - context.Result = definitionNodes; - } - - public override void VisitTypes(TypeDefinitionCollection typesDefinition, VisitorContext context) - { - var definitionNodes = new List(); - - if (context.Schema.QueryType is not null) - { - VisitType(context.Schema.QueryType, context); - definitionNodes.Add((IDefinitionNode)context.Result!); - } - - if (context.Schema.MutationType is not null) - { - VisitType(context.Schema.MutationType, context); - definitionNodes.Add((IDefinitionNode)context.Result!); - } - - if (context.Schema.SubscriptionType is not null) - { - VisitType(context.Schema.SubscriptionType, context); - definitionNodes.Add((IDefinitionNode)context.Result!); - } - - foreach (var type in typesDefinition.OfType().OrderBy(t => t.Name)) - { - if (context.Schema?.QueryType == type - || context.Schema?.MutationType == type - || context.Schema?.SubscriptionType == type) - { - continue; - } - - VisitType(type, context); - definitionNodes.Add((IDefinitionNode)context.Result!); - } - - foreach (var type in typesDefinition.OfType().OrderBy(t => t.Name)) - { - VisitType(type, context); - definitionNodes.Add((IDefinitionNode)context.Result!); - } - - foreach (var type in typesDefinition.OfType().OrderBy(t => t.Name)) - { - VisitType(type, context); - definitionNodes.Add((IDefinitionNode)context.Result!); - } - - foreach (var type in typesDefinition.OfType().OrderBy(t => t.Name)) - { - VisitType(type, context); - definitionNodes.Add((IDefinitionNode)context.Result!); - } - - foreach (var type in typesDefinition.OfType().OrderBy(t => t.Name)) - { - VisitType(type, context); - definitionNodes.Add((IDefinitionNode)context.Result!); - } - - foreach (var type in typesDefinition.OfType().OrderBy(t => t.Name)) - { - if (!context.PrintSpecScalars - && (type is { IsSpecScalar: true } - || SpecScalarNames.IsSpecScalar(type.Name))) - { - continue; - } - - VisitType(type, context); - definitionNodes.Add((IDefinitionNode)context.Result!); - } - - context.Result = definitionNodes; - } - - public override void VisitDirectiveDefinitions( - DirectiveDefinitionCollection directiveTypes, - VisitorContext context) - { - var definitionNodes = new List(); - - foreach (var type in directiveTypes.AsEnumerable().OrderBy(t => t.Name, context.OrderByName)) - { - if (DirectiveNames.IsSpecDirective(type.Name)) - { - continue; - } - - VisitDirectiveDefinition(type, context); - definitionNodes.Add((IDefinitionNode)context.Result!); - } - - context.Result = definitionNodes; - } - - public override void VisitObjectType(MutableObjectTypeDefinition type, VisitorContext context) - { - VisitDirectives(type.Directives, context); - var directives = (List)context.Result!; - - VisitOutputFields(type.Fields, context); - var fields = (List)context.Result!; - - context.Result = - type.GetTypeMetadata().IsExtension - ? new ObjectTypeExtensionNode( - null, - new NameNode(type.Name), - directives, - type.Implements.AsEnumerable().Select(t => new NamedTypeNode(t.Name)).ToList(), - fields) - : new ObjectTypeDefinitionNode( - null, - new NameNode(type.Name), - CreateDescription(type.Description), - directives, - type.Implements.AsEnumerable().Select(t => new NamedTypeNode(t.Name)).ToList(), - fields); - } - - public override void VisitInterfaceType(MutableInterfaceTypeDefinition type, VisitorContext context) - { - VisitDirectives(type.Directives, context); - var directives = (List)context.Result!; - - VisitOutputFields(type.Fields, context); - var fields = (List)context.Result!; - - context.Result = - type.GetTypeMetadata().IsExtension - ? new InterfaceTypeExtensionNode( - null, - new NameNode(type.Name), - directives, - type.Implements.AsEnumerable().Select(t => new NamedTypeNode(t.Name)).ToList(), - fields) - : new InterfaceTypeDefinitionNode( - null, - new NameNode(type.Name), - CreateDescription(type.Description), - directives, - type.Implements.AsEnumerable().Select(t => new NamedTypeNode(t.Name)).ToList(), - fields); - } - - public override void VisitInputObjectType(MutableInputObjectTypeDefinition type, VisitorContext context) - { - VisitDirectives(type.Directives, context); - var directives = (List)context.Result!; - - VisitInputFields(type.Fields, context); - var fields = (List)context.Result!; - - context.Result = - type.GetTypeMetadata().IsExtension - ? new InputObjectTypeExtensionNode( - null, - new NameNode(type.Name), - directives, - fields) - : new InputObjectTypeDefinitionNode( - null, - new NameNode(type.Name), - CreateDescription(type.Description), - directives, - fields); - } - - public override void VisitScalarType(MutableScalarTypeDefinition type, VisitorContext context) - { - VisitDirectives(type.Directives, context); - var directives = (List)context.Result!; - - context.Result = - type.GetTypeMetadata().IsExtension - ? new ScalarTypeExtensionNode( - null, - new NameNode(type.Name), - directives) - : new ScalarTypeDefinitionNode( - null, - new NameNode(type.Name), - CreateDescription(type.Description), - directives); - } - - public override void VisitEnumType(MutableEnumTypeDefinition type, VisitorContext context) - { - VisitDirectives(type.Directives, context); - var directives = (List)context.Result!; - - VisitEnumValues(type.Values, context); - var values = (List)context.Result!; - - context.Result = - type.GetTypeMetadata().IsExtension - ? new EnumTypeExtensionNode( - null, - new NameNode(type.Name), - directives, - values) - : new EnumTypeDefinitionNode( - null, - new NameNode(type.Name), - CreateDescription(type.Description), - directives, - values); - } - - public override void VisitEnumValues(EnumValueCollection values, VisitorContext context) - { - var definitionNodes = new List(); - - foreach (var value in values.AsEnumerable().OrderBy(t => t.Name, context.OrderByName)) - { - VisitEnumValue(value, context); - definitionNodes.Add((EnumValueDefinitionNode)context.Result!); - } - - context.Result = definitionNodes; - } - - public override void VisitEnumValue(MutableEnumValue value, VisitorContext context) - { - VisitDirectives(value.Directives, context); - var directives = (List)context.Result!; - - directives = ApplyDeprecatedDirective(value, directives); - - context.Result = new EnumValueDefinitionNode( - null, - new NameNode(value.Name), - CreateDescription(value.Description), - directives); - } - - public override void VisitUnionType(MutableUnionTypeDefinition type, VisitorContext context) - { - VisitDirectives(type.Directives, context); - var directives = (List)context.Result!; - - context.Result = - type.GetTypeMetadata().IsExtension - ? new UnionTypeExtensionNode( - null, - new NameNode(type.Name), - directives, - type.Types.AsEnumerable().Select(t => new NamedTypeNode(t.Name)).ToList()) - : new UnionTypeDefinitionNode( - null, - new NameNode(type.Name), - CreateDescription(type.Description), - directives, - type.Types.AsEnumerable().Select(t => new NamedTypeNode(t.Name)).ToList()); - } - - public override void VisitDirectiveDefinition( - MutableDirectiveDefinition mutableDirective, - VisitorContext context) - { - VisitInputFields(mutableDirective.Arguments, context); - var arguments = (List)context.Result!; - - context.Result = - new DirectiveDefinitionNode( - null, - new NameNode(mutableDirective.Name), - CreateDescription(mutableDirective.Description), - mutableDirective.IsRepeatable, - arguments, - mutableDirective.Locations.ToNameNodes()); - } - - public override void VisitOutputFields( - OutputFieldDefinitionCollection fields, - VisitorContext context) - { - var fieldNodes = new List(); - - foreach (var field in fields.AsEnumerable().OrderBy(t => t.Name, context.OrderByName)) - { - VisitOutputField(field, context); - fieldNodes.Add((FieldDefinitionNode)context.Result!); - } - - context.Result = fieldNodes; - } - - public override void VisitOutputField(MutableOutputFieldDefinition field, VisitorContext context) - { - VisitInputFields(field.Arguments, context); - var arguments = (List)context.Result!; - - VisitDirectives(field.Directives, context); - var directives = (List)context.Result!; - - directives = ApplyDeprecatedDirective(field, directives); - - context.Result = new FieldDefinitionNode( - null, - new NameNode(field.Name), - CreateDescription(field.Description), - arguments, - field.Type.ToTypeNode(), - directives); - } - - public override void VisitInputFields( - InputFieldDefinitionCollection fields, - VisitorContext context) - { - var inputNodes = new List(); - - foreach (var field in fields.AsEnumerable().OrderBy(t => t.Name, context.OrderByName)) - { - VisitInputField(field, context); - inputNodes.Add((InputValueDefinitionNode)context.Result!); - } - - context.Result = inputNodes; - } - - public override void VisitInputField(MutableInputFieldDefinition field, VisitorContext context) - { - VisitDirectives(field.Directives, context); - var directives = (List)context.Result!; - - directives = ApplyDeprecatedDirective(field, directives); - - context.Result = new InputValueDefinitionNode( - null, - new NameNode(field.Name), - CreateDescription(field.Description), - field.Type.ToTypeNode(), - field.DefaultValue, - directives); - } - - public override void VisitDirectives(DirectiveCollection directives, VisitorContext context) - { - var directiveNodes = new List(); - - foreach (var directive in directives) - { - VisitDirective(directive, context); - directiveNodes.Add((DirectiveNode)context.Result!); - } - - context.Result = directiveNodes; - } - - public override void VisitDirective(Directive directive, VisitorContext context) - { - VisitArguments(directive.Arguments, context); - context.Result = new DirectiveNode( - null, - new NameNode(directive.Name), - (List)context.Result!); - } - - public override void VisitArguments( - ArgumentAssignmentCollection arguments, - VisitorContext context) - { - var argumentNodes = new List(); - - foreach (var argument in arguments) - { - VisitArgument(argument, context); - argumentNodes.Add((ArgumentNode)context.Result!); - } - - context.Result = argumentNodes; - } - - public override void VisitArgument(ArgumentAssignment argument, VisitorContext context) - { - context.Result = new ArgumentNode(argument.Name, argument.Value); - } - - private static List ApplyDeprecatedDirective( - IDeprecationProvider canBeDeprecated, - List directives) - { - if (canBeDeprecated.IsDeprecated) - { - var deprecateDirective = CreateDeprecatedDirective(canBeDeprecated.DeprecationReason); - - if (directives.Count == 0) - { - directives = [deprecateDirective]; - } - else - { - var temp = directives.ToList(); - temp.Add(deprecateDirective); - directives = temp; - } - } - - return directives; - } - - private static DirectiveNode CreateDeprecatedDirective(string? reason = null) - { - if (string.IsNullOrEmpty(reason)) - { - reason = DirectiveNames.Deprecated.Arguments.DefaultReason; - } - - return new DirectiveNode( - new NameNode(DirectiveNames.Deprecated.Name), - new[] { new ArgumentNode(DirectiveNames.Deprecated.Arguments.Reason, reason) }); - } - - private static StringValueNode? CreateDescription(string? description) - { - if (string.IsNullOrEmpty(description)) - { - return null; - } - - // Get rid of any unnecessary whitespace. - description = description.Trim(); - - var isBlock = description.Contains('\n'); - - return new StringValueNode(null, description, isBlock); - } - } - - private sealed record VisitorContext - { - public required MutableSchemaDefinition Schema { get; init; } - - public required bool OrderByName { get; init; } - - public required bool PrintSpecScalars { get; init; } - - public required bool PrintSpecDirectives { get; init; } - - public object? Result { get; set; } - } -} diff --git a/src/HotChocolate/Mutable/src/Types.Mutable/Serialization/SchemaFormatterOptions.cs b/src/HotChocolate/Mutable/src/Types.Mutable/Serialization/SchemaFormatterOptions.cs deleted file mode 100644 index 7e36d8f5196..00000000000 --- a/src/HotChocolate/Mutable/src/Types.Mutable/Serialization/SchemaFormatterOptions.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace HotChocolate.Types.Mutable.Serialization; - -public struct SchemaFormatterOptions -{ - public bool? OrderByName { get; set; } - - public bool? Indented { get; set; } - - public bool? PrintSpecScalars { get; set; } - - public bool? PrintSpecDirectives { get; set; } -} diff --git a/src/HotChocolate/Mutable/src/Types.Mutable/Serialization/SchemaParser.cs b/src/HotChocolate/Mutable/src/Types.Mutable/Serialization/SchemaParser.cs index 9f09521deb6..0a9eaed3b10 100644 --- a/src/HotChocolate/Mutable/src/Types.Mutable/Serialization/SchemaParser.cs +++ b/src/HotChocolate/Mutable/src/Types.Mutable/Serialization/SchemaParser.cs @@ -155,37 +155,37 @@ private static void DiscoverExtensions(MutableSchemaDefinition schema, DocumentN { case EnumTypeExtensionNode: var enumType = new MutableEnumTypeDefinition(typeExt.Name.Value); - enumType.GetTypeMetadata().IsExtension = true; + enumType.MarkAsExtension(); schema.Types.Add(enumType); break; case InputObjectTypeExtensionNode: var inputObjectType = new MutableInputObjectTypeDefinition(typeExt.Name.Value); - inputObjectType.GetTypeMetadata().IsExtension = true; + inputObjectType.MarkAsExtension(); schema.Types.Add(inputObjectType); break; case InterfaceTypeExtensionNode: var interfaceType = new MutableInterfaceTypeDefinition(typeExt.Name.Value); - interfaceType.GetTypeMetadata().IsExtension = true; + interfaceType.MarkAsExtension(); schema.Types.Add(interfaceType); break; case ObjectTypeExtensionNode: var objectType = new MutableObjectTypeDefinition(typeExt.Name.Value); - objectType.GetTypeMetadata().IsExtension = true; + objectType.MarkAsExtension(); schema.Types.Add(objectType); break; case ScalarTypeExtensionNode: var scalarType = new MutableScalarTypeDefinition(typeExt.Name.Value); - scalarType.GetTypeMetadata().IsExtension = true; + scalarType.MarkAsExtension(); schema.Types.Add(scalarType); break; case UnionTypeExtensionNode: var unionType = new MutableUnionTypeDefinition(typeExt.Name.Value); - unionType.GetTypeMetadata().IsExtension = true; + unionType.MarkAsExtension(); schema.Types.Add(unionType); break; diff --git a/src/HotChocolate/Mutable/src/Types.Mutable/TypeMetadata.cs b/src/HotChocolate/Mutable/src/Types.Mutable/TypeMetadata.cs deleted file mode 100644 index 72b987fd61f..00000000000 --- a/src/HotChocolate/Mutable/src/Types.Mutable/TypeMetadata.cs +++ /dev/null @@ -1,36 +0,0 @@ -using HotChocolate.Features; - -namespace HotChocolate.Types.Mutable; - -public sealed class TypeMetadata : ISealable -{ - private bool _isReadOnly; - - public bool IsExtension - { - get; - set - { - if (_isReadOnly) - { - throw new NotSupportedException( - "The metadata is sealed and cannot be modified."); - } - - field = value; - } - } - - public bool IsReadOnly => _isReadOnly; - - public void Seal() - { - if (_isReadOnly) - { - throw new NotSupportedException( - "The metadata is sealed and cannot be modified."); - } - - _isReadOnly = true; - } -} diff --git a/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/__snapshots__/ConventionTests.ListType_Should_NotContainAllOperation.snap b/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/__snapshots__/ConventionTests.ListType_Should_NotContainAllOperation.snap index 0d765ae9af5..0e7c36db0bd 100644 --- a/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/__snapshots__/ConventionTests.ListType_Should_NotContainAllOperation.snap +++ b/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/__snapshots__/ConventionTests.ListType_Should_NotContainAllOperation.snap @@ -2,11 +2,6 @@ schema { query: Query } -type ListItem { - id: String - foo: String -} - type Query { root(where: TypeWithListFilterInput @cost(weight: "10")): [TypeWithList] @cost(weight: "10") @@ -14,6 +9,11 @@ type Query { @cost(weight: "10") } +type ListItem { + id: String + foo: String +} + type TypeWithList { id: String list: [ListItem!] diff --git a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonLineStringTypeTests.LineString_Execution_Tests.graphql b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonLineStringTypeTests.LineString_Execution_Tests.graphql index 5b796bd46af..46805fe3d4a 100644 --- a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonLineStringTypeTests.LineString_Execution_Tests.graphql +++ b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonLineStringTypeTests.LineString_Execution_Tests.graphql @@ -2,13 +2,8 @@ schema { query: Query } -interface GeoJSONInterface { - "The geometry type of the GeoJson object" - type: GeoJSONGeometryType! - "The minimum bounding box around the geometry object" - bbox: [Float] - "The coordinate reference system integer identifier" - crs: Int +type Query { + test: GeoJSONLineStringType } type GeoJSONLineStringType implements GeoJSONInterface { @@ -22,8 +17,13 @@ type GeoJSONLineStringType implements GeoJSONInterface { crs: Int! } -type Query { - test: GeoJSONLineStringType +interface GeoJSONInterface { + "The geometry type of the GeoJson object" + type: GeoJSONGeometryType! + "The minimum bounding box around the geometry object" + bbox: [Float] + "The coordinate reference system integer identifier" + crs: Int } enum GeoJSONGeometryType { diff --git a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiLineStringTypeTests.MultiLineString_Execution_Tests.graphql b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiLineStringTypeTests.MultiLineString_Execution_Tests.graphql index 49416bac46a..634ddcb5f76 100644 --- a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiLineStringTypeTests.MultiLineString_Execution_Tests.graphql +++ b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiLineStringTypeTests.MultiLineString_Execution_Tests.graphql @@ -2,13 +2,8 @@ schema { query: Query } -interface GeoJSONInterface { - "The geometry type of the GeoJson object" - type: GeoJSONGeometryType! - "The minimum bounding box around the geometry object" - bbox: [Float] - "The coordinate reference system integer identifier" - crs: Int +type Query { + test: GeoJSONMultiLineStringType } type GeoJSONMultiLineStringType implements GeoJSONInterface { @@ -22,8 +17,13 @@ type GeoJSONMultiLineStringType implements GeoJSONInterface { crs: Int! } -type Query { - test: GeoJSONMultiLineStringType +interface GeoJSONInterface { + "The geometry type of the GeoJson object" + type: GeoJSONGeometryType! + "The minimum bounding box around the geometry object" + bbox: [Float] + "The coordinate reference system integer identifier" + crs: Int } enum GeoJSONGeometryType { diff --git a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiPointInputTests.Schema_Tests.graphql b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiPointInputTests.Schema_Tests.graphql index c86574a9894..44abbc4f31f 100644 --- a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiPointInputTests.Schema_Tests.graphql +++ b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiPointInputTests.Schema_Tests.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type MockObjectType { - fieldResolver: Geometry -} - type Query { test(arg: GeoJSONMultiPointInput): String } +type MockObjectType { + fieldResolver: Geometry +} + input GeoJSONMultiPointInput { "The geometry type of the GeoJson object" type: GeoJSONGeometryType diff --git a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiPointTypeTests.MultiPoint_Execution_Tests.graphql b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiPointTypeTests.MultiPoint_Execution_Tests.graphql index 8c9e1793369..45dd05cd975 100644 --- a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiPointTypeTests.MultiPoint_Execution_Tests.graphql +++ b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiPointTypeTests.MultiPoint_Execution_Tests.graphql @@ -2,13 +2,8 @@ schema { query: Query } -interface GeoJSONInterface { - "The geometry type of the GeoJson object" - type: GeoJSONGeometryType! - "The minimum bounding box around the geometry object" - bbox: [Float] - "The coordinate reference system integer identifier" - crs: Int +type Query { + test: GeoJSONMultiPointType } type GeoJSONMultiPointType implements GeoJSONInterface { @@ -22,8 +17,13 @@ type GeoJSONMultiPointType implements GeoJSONInterface { crs: Int! } -type Query { - test: GeoJSONMultiPointType +interface GeoJSONInterface { + "The geometry type of the GeoJson object" + type: GeoJSONGeometryType! + "The minimum bounding box around the geometry object" + bbox: [Float] + "The coordinate reference system integer identifier" + crs: Int } enum GeoJSONGeometryType { diff --git a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiPolygonTypeTests.MultiPolygon_Execution_Tests.graphql b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiPolygonTypeTests.MultiPolygon_Execution_Tests.graphql index 7ffd40bc9f0..b48ecdf07ca 100644 --- a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiPolygonTypeTests.MultiPolygon_Execution_Tests.graphql +++ b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonMultiPolygonTypeTests.MultiPolygon_Execution_Tests.graphql @@ -2,13 +2,8 @@ schema { query: Query } -interface GeoJSONInterface { - "The geometry type of the GeoJson object" - type: GeoJSONGeometryType! - "The minimum bounding box around the geometry object" - bbox: [Float] - "The coordinate reference system integer identifier" - crs: Int +type Query { + test: GeoJSONMultiPolygonType } type GeoJSONMultiPolygonType implements GeoJSONInterface { @@ -22,8 +17,13 @@ type GeoJSONMultiPolygonType implements GeoJSONInterface { crs: Int! } -type Query { - test: GeoJSONMultiPolygonType +interface GeoJSONInterface { + "The geometry type of the GeoJson object" + type: GeoJSONGeometryType! + "The minimum bounding box around the geometry object" + bbox: [Float] + "The coordinate reference system integer identifier" + crs: Int } enum GeoJSONGeometryType { diff --git a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonPointInputTests.Schema_Tests.graphql b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonPointInputTests.Schema_Tests.graphql index f8dd2799753..3c8efcc1602 100644 --- a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonPointInputTests.Schema_Tests.graphql +++ b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonPointInputTests.Schema_Tests.graphql @@ -2,14 +2,14 @@ schema { query: Query } -type MockObjectType { - fieldResolver: Geometry -} - type Query { test(arg: GeoJSONPointInput): String } +type MockObjectType { + fieldResolver: Geometry +} + input GeoJSONPointInput { "The geometry type of the GeoJson object" type: GeoJSONGeometryType diff --git a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonPointTypeTests.Point_Execution_Tests.graphql b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonPointTypeTests.Point_Execution_Tests.graphql index 6261f108757..e5de36ec09d 100644 --- a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonPointTypeTests.Point_Execution_Tests.graphql +++ b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonPointTypeTests.Point_Execution_Tests.graphql @@ -2,13 +2,8 @@ schema { query: Query } -interface GeoJSONInterface { - "The geometry type of the GeoJson object" - type: GeoJSONGeometryType! - "The minimum bounding box around the geometry object" - bbox: [Float] - "The coordinate reference system integer identifier" - crs: Int +type Query { + test: GeoJSONPointType } type GeoJSONPointType implements GeoJSONInterface { @@ -22,8 +17,13 @@ type GeoJSONPointType implements GeoJSONInterface { crs: Int! } -type Query { - test: GeoJSONPointType +interface GeoJSONInterface { + "The geometry type of the GeoJson object" + type: GeoJSONGeometryType! + "The minimum bounding box around the geometry object" + bbox: [Float] + "The coordinate reference system integer identifier" + crs: Int } enum GeoJSONGeometryType { diff --git a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonPolygonTypeTests.Polygon_Execution_Tests.graphql b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonPolygonTypeTests.Polygon_Execution_Tests.graphql index 2bb2bb6a650..b0874389f75 100644 --- a/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonPolygonTypeTests.Polygon_Execution_Tests.graphql +++ b/src/HotChocolate/Spatial/test/Types.Tests/__snapshots__/GeoJsonPolygonTypeTests.Polygon_Execution_Tests.graphql @@ -2,13 +2,8 @@ schema { query: Query } -interface GeoJSONInterface { - "The geometry type of the GeoJson object" - type: GeoJSONGeometryType! - "The minimum bounding box around the geometry object" - bbox: [Float] - "The coordinate reference system integer identifier" - crs: Int +type Query { + test: GeoJSONPolygonType } type GeoJSONPolygonType implements GeoJSONInterface { @@ -22,8 +17,13 @@ type GeoJSONPolygonType implements GeoJSONInterface { crs: Int! } -type Query { - test: GeoJSONPolygonType +interface GeoJSONInterface { + "The geometry type of the GeoJson object" + type: GeoJSONGeometryType! + "The minimum bounding box around the geometry object" + bbox: [Float] + "The coordinate reference system integer identifier" + crs: Int } enum GeoJSONGeometryType {