Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/johnbiundo/bug-graphql-subscrip


https://github.com/johnbiundo/bug-graphql-subscrip

Last synced: 9 days ago
JSON representation

Awesome Lists containing this project

README

        

## Issue

Adding a subscription triggered by a mutation; returns `data: null` in the subscription when a correct mutation succeeds.

## Install

Usual install `npm i`

## Subscription and Mutation queries

Once installed and running, you can reproduce the bug by subscribing as shown below and running the mutation shown below in the playground on `localhost:3000/graphql`

```gql
"""
subscription
"""

subscription custAdd {
custAdded {
firstName
lastName
}
}

"""
mutation
"""

mutation addCustomer($cust: NewCustomer!)
{
addCustomer(newCustomer: $cust) {
id
email
firstName
lastName
}
}

"""
input object for addCustomer mutation
"""

{
"cust": {
"firstName": "Bill",
"lastName": "Jones",
"email": "[email protected]"
}
}
```