graphql-python / graphene

GraphQL framework for Python
http://graphene-python.org/
MIT License
8.1k stars 828 forks source link

More documentation for DisableIntrospection? #1552

Open dwjp opened 6 months ago

dwjp commented 6 months ago

The docs currently give this example:

validation_errors = validate(
    schema=schema.graphql_schema,
    document_ast=parse('THE QUERY'),
    rules=(
        DisableIntrospection,
    )
)

But it's not obvious how to set document_ast, and leave it as an exercise to the reader assuming knowledge on Query AST. How should this be setup to disable introspection across all queries?

(Appreciate you might prefer support requests elsewhere, but no hits on my SO post on this https://stackoverflow.com/questions/78100152/how-to-disable-introspection-on-graphene-python/78498422#78498422 and see it was also raised in https://github.com/graphql-python/graphene/issues/1388#issuecomment-1282388489)