Forked from bradtraversy/graphql-queries-mutations.md
Created
March 17, 2023 09:54
-
-
Save jme-sull/bc11437681b5099cdd8008c0079d5fdf to your computer and use it in GitHub Desktop.
Revisions
-
jme-sull revised this gist
Mar 17, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -69,7 +69,7 @@ mutation { ## Create a new project and return name and description ``` mutation { addProject(name: "Mobile App", description: "This is the project description", status: new, clientId: "1") { name description } -
bradtraversy created this gist
Jun 2, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,88 @@ # GraphQL Queries & Mutations These are the GraphQL queries and mutations for the YouTube course. ## Get names of all clients ``` { clients { name } } ``` ## Get a single client name and email ``` { client(id: 1) { name email } } ``` ## Get name and status of all projects ``` { projects { name status } } ``` ## Get a single project name, description along with the client name and email ``` { project(id: 1) { name description, client { name email } } } ``` ## Create a new client and return all data ``` mutation { addClient(name: "Tony Stark", email: "ironman@gmail.com", phone: "955-365-3376") { id name email phone } } ``` ## Delete a client and return id ``` mutation { deleteClient(id: 1) { id } } ``` ## Create a new project and return name and description ``` mutation { addProject(name: "Mobile App", description: "This is the project description", status: "new", clientId: "1") { name description } } ``` ## Update a project status and return name and status ``` mutation { updateProject(status: "completed") { name status } } ```