API for React + GraphQL workshop
GraphQL API powering the Whisperer application where you can share your thoughts anonymously.
It's powered by:
apollo-server is the core library for Apollo Server itself, which helps you define the shape of your data and how to fetch it.
graphql is the library used to build a GraphQL schema and execute queries against it.
The schema for the whisperer-API can be found here. There are a number of queries and mutations contained in that file and that is what makes us up the Whisperer-API. There is work ongoing to add subscriptions to the API.
The following are the queries available on the whisperer API.
Example:
query {
users {
id
name
surname
email
username
}
}
query {
profile {
id
name
email
username
whispers {
id
text
}
}
}
query {
whispers {
id
text
whisperer {
id
username
}
}
}
The following are the queries available on the whisperer API.
/signup
endpoint on a traditional REST API.mutation {
createUser(
payload: {
name: "Bolaji"
email: "[email protected]"
password: "password123"
confirmPassword: "password123"
}
) {
token
user {
id
username
email
name
}
}
}
/signin
endpoint on a traditional REST API.mutation {
signin(
payload: {
email: "[email protected]"
password: "password123"
}
) {
token
user {
id
username
email
name
}
}
}
mutation {
createWhsiper(
payload: {
text: "I am bored"
}
) {
id
text
whisperer {
id
username
}
}
}