graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

AllowIntrospection validation from SchemaBuilder

Open rohkhann opened this issue 1 year ago • 0 comments

Product

Hot Chocolate

Is your feature request related to a problem?

Im trying to use the Schema first logic of hotchocolate in my graphql application. I have a schemaBuilder that builds the graphql schema using a json. Post this I want to be able to disable introspection on the schema but I have no graphql server setup. My code looks like the follows: ` ISchema schema = schemaBuilder.Create();

        IRequestExecutor requestExecutable = schema.MakeExecutable();

        // if no executable options then query endpoint without passing them in.
        IExecutionResult result = variableValues == null ? requestExecutable.Execute(query) : requestExecutable.Execute(query, variableValues);`

In the above, how do i set this property to false, I dont see any option to disable introspection.

The solution you'd like

Solution that would help would be something like, schemaBuilder.ModifyOptions(o => o.AllowIntrospection = false);

Please do let me know if there are any other workarounds that I can use?

rohkhann avatar Mar 04 '24 20:03 rohkhann