cheatsheets

GraphQL Cheatsheet

Spis treści

Mutation

Mutacje — createUser

https://graphql.org/graphql-js/mutations-and-input-types/

mutation {
  createUser(data: {
    name: "piecioshka"
  }) {
    id
    name
  }
}
// 5c157dbfa7b11b0007c1767c

Mutation — deleteUser

mutation {
  deleteUser(where: {
    id: "5c157dbfa7b11b0007c1767c"
  }) {
    id
    name
  }
}

Spróbuj uruchomić 2x?

Query

https://graphql.org/learn/queries/

query {
  users {
    id
    name
  }
}

Subscription

https://graphql.org/blog/subscriptions-in-graphql-and-relay/

Apollo

TODO

Edytor

https://graphqleditor.com/

Prisma

DEMO: https://github.com/piecioshka/test-nodejs-prisma

Relay