Skip to content

How to add fragments #392

Answered by hayes
arunmenon1975 asked this question in Q&A
May 1, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Fragments are only used in queries. All spec compliant graphql execution environments should support them. Pothos only generates your graphql schema. How queries are executed (including interpreting fragments) is entirely up to the library that executes the queries in your server.

Most JS graphql servers (yoga, apollo, etc) just use the official graphql library for executing queries, and have options for replacing the default execution with graphql-jit. In either case, these fully support fragments. So there is nothing you need to add or change in Pothos, or your server environment to be able to use fragments with your existing graphql schema.

A query using a fragment might look something…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@arunmenon1975
Comment options

Answer selected by arunmenon1975
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants