Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daniloab/rbaf-graphql-api
Backend GraphQL Server.
https://github.com/daniloab/rbaf-graphql-api
Last synced: 25 days ago
JSON representation
Backend GraphQL Server.
- Host: GitHub
- URL: https://github.com/daniloab/rbaf-graphql-api
- Owner: daniloab
- Created: 2019-05-06T19:35:34.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-03-16T02:01:31.000Z (over 1 year ago)
- Last Synced: 2024-02-17T12:40:41.875Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.58 MB
- Stars: 44
- Watchers: 2
- Forks: 7
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# RBFA GraphQL API
RBFA API is an api to help teams from football in brazil to managed his dailies issues. If you want to see the client project, go to [here](https://github.com/daniloab/rbaf-web).
## Getting Started
This project use graphql, graphql-relay, koa framework, jsonwebtoken and others stuffs;
```bash
# clone repo
$ https://github.com/daniloab/rbaf-graphql-api.git
$ cd rbaf-graphql-api# install dependencies
$ yarn install# copy .env file
$ cp .env.example .env# start project
$ yarn start# see on graphiql graphql interface on localhost link
http://localhost:9001/graphql
```## Generating the schema
```bash
yarn schema
```## Queries
### User
- All
```gql
query {
users {
_id
name
username
password
}
}
```
- Auth
```gql
query {
me {
username
name
username
}
}
```
### Players
- All
```gql
query {
players {
_id
status
name
lastname
position
document
}
}
```
- By Id
```gql
query {
playerById(_id: "_id") {
_id
status
name
lastname
position
document
}
}
```
### Summary
_building, almost there ♥_## Mutations
### User
- Login
```gql
mutation {
LoginEmail(input: {
email:"[email protected]"
password:"jonpassword"
}) {
token
error
}
}
}
```
- Register
```gql
mutation {
RegisterEmail(input: {
name: "Ned"
username:"nedstark"
email:"[email protected]"
password:"ned123"
}) {
token
error
}
}
```
- Change Password
```gql
mutation {
ChangePassword(input: {
oldPassword:"oldPassword"
password:"newPassword"
})
}
```### Players
- Register and Update Player - If you add a new player, just pass the inputs withou _id
```gql
mutation {
RegisterPlayerMutation(input: {
_id:""
status:1,
name:"Sor"
lastname:"Jorah"
position:"Cornerback"
document:"3456576789"
}) {
newPlayer {
_id
status
name
lastname
position
document
}
error
}
}
```
- Remove Player
```gql
mutation {
RemovePlayer(input:{
_id: "_id"
}) {
name
lastname
error
}
}
```