Skip to content

Latest commit

 

History

History
75 lines (63 loc) · 922 Bytes

GraphQL.md

File metadata and controls

75 lines (63 loc) · 922 Bytes

Queries and Mutations

Create User Mutation

mutation createUser($input: CreateUserInput!) {
  createUser(input: $input) {
    _id
    name
    email
  }
}

Login User Mutation

mutation loginUser($input: LoginInput!) {
  loginUser(input: $input)
}

Get User Query

query {
  me {
    _id
    name
    email
  }
}

Create Product Mutation

mutation createProduct($input: CreateProductInput!) {
  createProduct(input: $input) {
    _id
    name
    price
    description
    productId
  }
}

Get Products Query

mutation createProduct($input: CreateProductInput!) {
  createProduct(input: $input) {
    _id
    name
    price
    description
    productId
  }
}

Get Product Query

query product($input: GetProductInput!) {
  product(input: $input) {
    _id
    productId
    name
    description
    price
  }
}