Reputation: 135
What library/server supports to do GraphQL simple(not restricted) queries in "dev mode", but in "prod mode" to use persisted queries instead of simple queries?
In "dev mode" we can be very flexible and not optimize queries, because in developing we do not need really fast queries.
In "prod mode" we can assign an id to each queries we have in application, so no need to parse queries every time, and we can write optimized queries to database.
Upvotes: 2
Views: 157
Reputation: 2894
It feels like you could simply wrap the 'persisted queries' logic in a conditional based on being in 'dev mode'. For example, don't add the middleware to the server, and don't add the network interface on the client unless in 'prod mode'.
Upvotes: 1