Skip to content

Instantly share code, notes, and snippets.

@renanmav
Created September 13, 2019 19:03
Show Gist options
  • Save renanmav/3ed7d66887c14f4645c57155c4341d13 to your computer and use it in GitHub Desktop.
Save renanmav/3ed7d66887c14f4645c57155c4341d13 to your computer and use it in GitHub Desktop.
import { GraphQLInterfaceType, GraphQLString, GraphQLInt } from 'graphql'
import UserType from '../modules/user/UserType'
const PostType = new GraphQLInterfaceType({
name: 'Post',
description: 'Post interface to enforce some fields',
fields: () => ({
content: { type: GraphQLString },
upvotes: { type: GraphQLInt },
downvotes: { type: GraphQLInt },
author: { type: UserType },
createdAt: { type: GraphQLString },
updatedAt: { type: GraphQLString }
})
})
export default PostType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment