Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 333 Bytes

Service.md

File metadata and controls

24 lines (19 loc) · 333 Bytes

GraphQL service will be created by defining types and fields

type Query {
    me: User
  }

  type User {
    id: ID
    name: String
  }

Then we create functions for each field on each type

function Query_me(request) {
    return request.auth.user;
}

fnuction User_name(user) {
    return user.getName();
}