Issue workflow progress
Progress of the issue based on the
Contributor Workflow
Describe the bug
Schema (User Service):
type User @canonical {
id: ID!
name: String!
organizationId: String!
}
Schema (Organization Service):
type Organization {
id: ID!
name: String!
users: [User!]
}
type User @key(selectionSet: "{ id }") {
id: ID!
organization: Organization @computed(selectionSet: "{ organizationId }")
}
Query:
query DoesNotWork {
users(ids: ["1", "2"]) { # user service
name
organization { # organization service with @computed directive
name
users { # user service
name
}
}
}
}
We have two services (User, Organization). Inside the Organization service we want to extend the type User with the field organization. Therefore we have to use the @computed directive. The type returned by the directive (in our case Organization) includes fields that must be resolved by the User service. This does not work and throws following error: Error: Cannot return null for non-nullable field User.name.
To Reproduce Steps to reproduce the behavior:
Open Sandbox and execute the default query named "DoesNotWork" in GraphiQL.
Expected behavior
Nested fields combined with the @computed directive are always resolved correctly.
Environment:
@graphql-tools/schema": "^10.0.2"
@graphql-tools/stitch": "^9.0.3"
@graphql-tools/stitching-directives": "^3.0.0"
- NodeJS: v20
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
Describe the bug
Schema (User Service):
Schema (Organization Service):
Query:
We have two services (User, Organization). Inside the Organization service we want to extend the type
Userwith the fieldorganization. Therefore we have to use the@computeddirective. The type returned by the directive (in our caseOrganization) includes fields that must be resolved by the User service. This does not work and throws following error:Error: Cannot return null for non-nullable field User.name.To Reproduce Steps to reproduce the behavior:
Open Sandbox and execute the default query named "DoesNotWork" in GraphiQL.
Expected behavior
Nested fields combined with the
@computeddirective are always resolved correctly.Environment:
@graphql-tools/schema": "^10.0.2"@graphql-tools/stitch": "^9.0.3"@graphql-tools/stitching-directives": "^3.0.0"