Skip to content

Instantly share code, notes, and snippets.

@RyanCCollins
Created October 11, 2016 23:51
Show Gist options
  • Save RyanCCollins/1aae670e2254c8137a84530a5d991e7e to your computer and use it in GitHub Desktop.
Save RyanCCollins/1aae670e2254c8137a84530a5d991e7e to your computer and use it in GitHub Desktop.
AuthUserType = GraphQL::ObjectType.define do
name 'AuthUser'
description 'The authenticated user model type'
field :id, types.ID, 'The id of this user'
field :name, !types.String, 'The name of the user'
field :email, !types.String, 'The email of the user'
field :bio, types.String, 'The bio of the user'
field :created_at, types.String, 'The datetime string when the user was created'
field :events, types[EventType], 'The user events'
field :avatar, types.String, 'The user avatar'
field :auth_token, types.String, 'The user auth token'
end
UserType = GraphQL::ObjectType.define do
name 'User'
description 'The user model type'
field :id, types.ID, 'The id of this user'
field :name, !types.String, 'The name of the user'
field :bio, types.String, 'The bio of the user'
field :events, types[EventType], 'The user events'
field :avatar, types.String, 'The user avatar'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment