apollographql / apollo-server

🌍  Spec-compliant and production ready JavaScript GraphQL server that lets you develop in a schema-first way. Built for Express, Connect, Hapi, Koa, and more.
https://www.apollographql.com/docs/apollo-server/
MIT License
13.79k stars 2.03k forks source link

How to whitelist persisted queries and disallow arbitrary queries? #1793

Closed joonhocho closed 5 years ago

joonhocho commented 6 years ago

I want disallow arbitrary queries from client to prevent abusive queries. How do I extract and compute query hashes and save it as a query white list file and use load it on apollo server to whitelist them? I've tried apollo-cli apollo queries:extract, but its hashed value does not match the one created by apollo-link-persisted-queries.

https://github.com/apollographql/apollo-link-persisted-queries/issues/28

jbaxleyiii commented 5 years ago

@joonhocho you can do this today! https://www.apollographql.com/docs/platform/operation-registry/

PrimarchAlpharius commented 4 years ago

@jbaxleyiii I do understand you also have to make money somehow :) Still, is there a way of doing this manually and not relying on the apollo graph manager service? For some smaller/pet projects, paying just for the whitelist funcionality is not worth it.

maclockard commented 1 year ago

@jbaxleyiii I can no longer find any mention of the operation registry in the docs. Is this functionality no longer available?

glasser commented 1 year ago

The operation registry/safelist feature of Apollo GraphOS is no longer enabled for graphs that have not yet used it. If you're interested in this kind of functionality, I encourage you to contact support@apollographql.com, and we'd be happy to talk to you about whether or not this older feature is a good fit for your use case, or whether some alternatives we are currently working on would work better.

maclockard commented 1 year ago

Okay, I'm probably just going to roll my own plugin for right now. Thanks though!