I am trying to disable GraphQL Introspection in my project and not having much luck with specific framework I am using. Im using the graphql-dotnet library v3 Should i update to the lastest?(v7)
I tried creating a custom schema filter and returning false. I take the idea from this issue https://github.com/graphql-dotnet/graphql-dotnet/issues/2692
Debugging i realized that the query object that comes with the request give me the information of what Operation its running. So calling query.OperationName tells you if its Introspection, mutation or a simple query.
This implementation solved my problem: