https://github.com/doniaskima/first-graphql-app
GraphQL is a query language for APIs that enables efficient data retrieval by allowing clients to request specific data fields, reducing over-fetching and under-fetching. It provides a flexible and efficient alternative to traditional RESTful APIs.
https://github.com/doniaskima/first-graphql-app
Last synced: about 1 month ago
JSON representation
GraphQL is a query language for APIs that enables efficient data retrieval by allowing clients to request specific data fields, reducing over-fetching and under-fetching. It provides a flexible and efficient alternative to traditional RESTful APIs.
- Host: GitHub
- URL: https://github.com/doniaskima/first-graphql-app
- Owner: doniaskima
- Created: 2023-06-09T22:16:39.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-06-10T00:10:42.000Z (almost 2 years ago)
- Last Synced: 2025-01-22T05:28:06.555Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 66.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# GraphQL Queries & Mutations
These are the GraphQL queries and mutations .
## Get names of all clients
```
{
clients {
name
}
}
```## Get a single client name and email
```
{
client(id: 1) {
name
}
}
```## 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
}
}
}
```## Create a new client and return all data
```
mutation {
addClient(name: "Tony Stark", email: "[email protected]", phone: "955-365-3376") {
id
name
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
}
}
```