Skip to content

Aandi1989/graphql-tutorial-nestjs

Repository files navigation

  1. npm run start:dev

  2. http://localhost:3000/graphql - graphQL playground where we can execute queries and mutations below. (It worked at least before we tried to connect real data base to this project) query { getUserById(id: 3) { id displayName username }

    getUsers{ id username settings { userId receiveEmails receiveNotifications } } }

mutation{ createUser(createUserData: { username: "duncan", displayName: "Duncan" }){ id username displayName } }

mutation { createUserSettings(createUserSettingsData: { userId:2 }){ userId receiveEmails receiveNotifications } }

  1. После подключения Prisma: Start app: npm run start:dev Open http://localhost:3000/graphql Run: mutation { createUser(createUserData: { username: "John", displayName: "John The Actor" }) { id username displayName } }

Then: mutation { createUserSettings(createUserSettingsData: { userId: 1, receiveNotifications: true, receiveEmails: false }) { userId receiveNotifications receiveEmails } }

Query all: query { getUsers { id username displayName settings { userId receiveNotifications receiveEmails } } }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published