I figured out how to make a subscription but now I...
# prisma-whats-new
c
I figured out how to make a subscription but now I’m getting the following error:
Copy code
The provided query doesn't include any known model name. Please check for the latest subscriptions API.
Relevant code:
Copy code
componentDidMount() {
    this.createDonationSubscription = this.props.allDonationsQuery.subscribeToMore(
      {
        document: gql`
          subscription {
            Donation {
              node {
                id
                amount
              }
            }
          }
        `,
        // updateQuery: (previousState, { subscriptionData }) => {
        //   const newDonation = subscriptionData.data.Donation.node;
        //   const donations = previousState.donations.concat([newDonation]);
        //   return {
        //     allDonations: donations
        //   };
        // },
        onError: err => console.error(err) // eslint-disable-line
      }
    );
  }
but when I try to run the following query in the graph.cool playground, it works fine (upon adding a Donation in another window):
Copy code
subscription {
  Donation {
    node {
      id
      amount
    }
  }
}
n
hey Chandler! Could you PM me your project id? šŸ™‚
c
sure
For anyone that cares, I got this working by going back to
Donations
. There may be an issue with schema migrations and subscriptions. https://www.graph.cool/forum/t/schema-name-changes-break-subscriptions/1002?u=chandlervdw
šŸ‘ 1