APIs
GraphQL
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.
1
2
3
4
5
6
7
8
9
10
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:
1
2
3
4
5
Run the query
Queries are simply HTTP endpoints on your WunderGraph server.
1
2
3
Learn more
Guides
How to write GraphQL and TypeScript operations.
Reference docs
All GraphQL introspection options.