Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ivanaquino/graphqlmultipleauthstarter

Apollo GraphQL Starter Multiple Auth
https://github.com/ivanaquino/graphqlmultipleauthstarter

Last synced: 7 days ago
JSON representation

Apollo GraphQL Starter Multiple Auth

Awesome Lists containing this project

README

        

# Graphql starter multiple type authentication

## Usage

```
docker-compose build
docker-compose up -d
```

### Url
localhost:9001

You can modify port in docker-compose.yaml file

## Mutations

#### Create user mutation
```
mutation createUser ($input: CreateUserRequest) {
createUser(input: $input) {
_id
name
}
}
```
#### Create user mutation variables

```
{
"input": {
"name": "My name",
"email": "[email protected]",
"password": "asdasd"
}
}
```

#### Create client mutation
```
mutation createClient ($input: CreateClientRequest) {
createClient (input: $input) {
_id
name
}
}
```
#### Create client mutation variables

```
{
"input": {
"name": "My name",
"email": "[email protected]",
"password": "asdasd"
}
}
```

#### Authenticate mutation
```
mutation authentication ($input: AuthenticationRequest) {
authenticate (input:$input) {
expiresIn
token
}
}
```

#### Authenticate mutation variables for user
```
{
"input": {
"username": "[email protected]",
"password": "asdasd",
"type": "user"
}
}
```

#### Authenticate mutation variables for client
```
{
"input": {
"username": "[email protected]",
"password": "asdasd",
"type": "client"
}
}
```