Skip to content

Instantly share code, notes, and snippets.

@ddialar
Created May 3, 2018 06:22
Show Gist options
  • Save ddialar/fec4896c77d69660818a8d6916874899 to your computer and use it in GitHub Desktop.
Save ddialar/fec4896c77d69660818a8d6916874899 to your computer and use it in GitHub Desktop.
Phone Number type definition for GraphQL back-end.
import {
GraphQLObjectType,
GraphQLInputObjectType,
GraphQLString,
GraphQLNonNull
} from 'graphql';
var ObjectType = new GraphQLObjectType({
name: 'PhoneNumber',
fields: () => ({
number: { type: new GraphQLNonNull(GraphQLString) },
description: { type: GraphQLString }
})
});
var InputType = new GraphQLInputObjectType({
name: 'PhoneNumberInput',
fields: () => ({
number: { type: new GraphQLNonNull(GraphQLString) },
description: { type: GraphQLString }
})
});
export {
ObjectType,
InputType
};
@ddialar
Copy link
Author

ddialar commented Mar 29, 2021

Just a suggestion, try to look for up-to-date content. The post where I used that gist was typed long time ago and related tasks are not done this way right now.

@ddialar
Copy link
Author

ddialar commented Mar 29, 2021

I've been checking and Apollo Server repository was create on April 17, 2016 and this gist code was created on August 27, 2017.

In that date Apollo Server was irrelevant yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment