The GraphQL DataSource allows you to connect any compatible GraphQL Server. WunderGraph supports Queries, Mutations as well as Subscriptions.
Add a GraphQL DataSource
To add a GraphQL data source, edit
.wundergraph/wundergraph.config.ts and introspect the GraphQL server like the config below.
The GraphQL data source is now added to your virtual graph and you can now write operations against it.
Write an operation
Create a new file
Countries.graphql in the
operations folder and add the following content:
Run the query
Queries are simply HTTP endpoints on your WunderGraph server.