Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@afreeland
Created May 1, 2018 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afreeland/1f3ecb594be5b39539cb2db9445209e9 to your computer and use it in GitHub Desktop.
Save afreeland/1f3ecb594be5b39539cb2db9445209e9 to your computer and use it in GitHub Desktop.
GraphQL: Enum Sample
import {
GraphQLEnumType,
} from 'graphql';
var recentTypes = new GraphQLEnumType({
name: 'recentTypess',
values: {
// The values are going to be used in the actual redis key itself
// i.e. analytics => recent:analytics:username
"Analytics" : { value: "analytics" },
"KPI": { value: "kpi" }
}
})
export default recentTypes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment