Skip to content

Instantly share code, notes, and snippets.

@clayallsopp
Created April 12, 2016 03:54
Show Gist options
  • Save clayallsopp/9191fad0163488006e9ab4bd7a5202d7 to your computer and use it in GitHub Desktop.
Save clayallsopp/9191fad0163488006e9ab4bd7a5202d7 to your computer and use it in GitHub Desktop.
import { GraphQLNonNull, GraphQLString } from 'graphql';
import { DirectiveLocation, GraphQLDirective } from 'graphql/type/directives';
const InstrumentDirective = new GraphQLDirective({
name: 'instrument',
description:
'Instrument the time it takes to resolve the field',
locations: [
DirectiveLocation.FIELD,
],
args: {
tag: {
type: new GraphQLNonNull(GraphQLString),
description: 'A tag to store in the metrics store'
}
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment