Created
April 12, 2016 03:54
-
-
Save clayallsopp/9191fad0163488006e9ab4bd7a5202d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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