Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Better support for boundary types without resolvers #135

Merged
merged 3 commits into from
May 31, 2024

Conversation

gmac
Copy link
Owner

@gmac gmac commented May 31, 2024

As pointed out by @thomasmarshall, it's actually okay for a boundary type without a resolver query to contain non-key fields, as long as those fields are resolvable elsewhere. For example:

# A
type T { id:ID! name:String } 
type Query { a(id: ID!):T @stitch(key: "id") }

# B
type T { id:ID! size:Float } 
type Query { b(id: ID!):T @stitch(key: "id") }

# C
type T { id:ID! size:Float name:String } 
type Query { c:T }

In the above, schema C does not provide a resolver query for T so it acts as an outbound-only type. This is okay because all of its fields can be resolved elsewhere when needed.

@gmac gmac merged commit c593a75 into main May 31, 2024
7 checks passed
@gmac gmac deleted the boundary_types_sans_resolver branch May 31, 2024 13:00
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant