GraphQL How to hide certain queries/mutations in schema

Viewed 18

I have a Java Spring app with multiple queries/mutations that I use with a GraphQL schema. However, some of those queries/mutations are meant to be for just testing. How would I make those "private" so that I can enable/disable them rather than writing them out each time or leaving them in there exposed?

For example, lets say my schema has these queries:

type Query {
    getStudent(studentId: String): Student
    getParent(studentId: String): Parent
}

I don't want the getParent() query exposed, but I also don't want to have to write it in the schema each time I run my app and I want to test it.

I only want getStudent() query exposed.

I also have some mutations that I want to "hide" as well, but I am assuming that would be the same process, if there is one.

Thanks!

0 Answers
Related