Guest User

Untitled

a guest
Apr 19th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. module Graph
  2. module Types
  3. User = GraphQL::ObjectType.define do
  4. name 'User'
  5. description 'A User'
  6.  
  7. implements GraphQL::Relay::Node.interface
  8.  
  9. field :id, !types.ID, property: :uuid
  10. field :name, types.String
  11. # ...
  12.  
  13. field :errors, types[types.String], "Reasons the object couldn't be created or updated" do
  14. resolve ->(obj, args, ctx) { obj.errors.full_messages }
  15. end
  16. end
  17. end
  18. end
Add Comment
Please, Sign In to add comment