I have really large number of gql schemas, I want to make sure performance doesn't get hurt by scanning the schema after request is received. I have single endpoint.
So, I want to add routing based on the operation name. For that I need to extract the name of operation as defined in schema.
In my example below, I want to get the name of operation name (e.g. getUser) defined in schema field (query or mutation) and route it to respective schema for execution.
{
"variables": {
"id": "5b02cf7aaadd477013855334"
},
"query": "query MainAction($id: String!){getUser(id: $id){user{name, email}, ...}}"
}
I tried extract it after parsing the query using QueryParser.parse(query), but I couldn't extract the schema names.
Regards,
Ros