DEV Community


GROQ vs. GraphQL?

Seth Corker
My main focus is JavaScript specialising in frontend UI with React. I like to explore different frameworks and technologies in my spare time. Learning languages (programming and real life) is a blast.
・1 min read

Sanity CMS supports query language called GROQ but you can also query data with GraphQL.

This got me thinking, what does GROQ give me that GraphQL doesn't. I'm interested in hearing your thoughts if you've used one, the other or both! What's the deal with GROQ?

What's your experience of GROQ and is there a reason to use it over a plain GraphQL query?

Discussion (3)

_lexedwards profile image
Alex Edwards • Edited

Currently using Sanity CMS in a project @ work - The team look as if they've got good momentum but specifically to Sanity, they seem to be more focused on a adaptability of GROQ. Documentation/support is more focused on GROQ, which might be detriment to users who are wanting to actively pursue GraphQL. Especially with their Gatsby plugin which is missing a couple of key features where we've had to utilise a couple of _raw fields which isn't ideal.

That said, I've looked @ GROQ, but definitely went for GraphQL for ease of use

pjotre86 profile image

Just googled it:
Looks solid. Would still go for graphql due to its adoption...

darthknoppix profile image
Seth Corker Author

Have you used GROQ before?

Thanks for the link, I’m leaning towards GraphQL too because of adoption.