You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The response map may also contain an entry with key extensions. This entry, if set, must have a map as its value. This entry is reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents.
The example they give is to use the extensions field for adding the amount of time consumed by running the provided query, which could perhaps be used by your development tools.
app.use('/graphql',graphqlHTTP(request=>{conststartTime=Date.now();return{schema: MyGraphQLSchema,graphiql: true,extensions({ document, variables, operationName, result }){return{runTime: Date.now()-startTime};}};}));
When querying this endpoint, it would include this information in the result, for example:
The GraphQL specification states:
express-graphql gives a good use case in their README.
The example they give is to use the extensions field for adding the amount of time consumed by running the provided query, which could perhaps be used by your development tools.
When querying this endpoint, it would include this information in the result, for example:
What do you think of implementing this into this project?
The text was updated successfully, but these errors were encountered: