Can You Hook the GraphQL API Up to Something Like Apollo?

2 replies
Last updated: Feb 25, 2021
Can you hook the graphql api up to something like apollo in order to access sanity with graphql in the same way that you can access it in gatsby but instead in NextJS? Or in any other way for that matter? And is it possible to do queries and mutations via the graphql api?
Yes it's possible to use graphql api with next.js (or any other framework) but you can't use mutations via the graphql api
https://www.sanity.io/docs/graphql#mutations-fa863fdd4c6a
and you can use any client you want, even native fetch or axios

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?