question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve and test compatibility with GraphQLJSON

See original GitHub issue

Hi! I’m trying to use apollo-client with GraphQLJSON.

Using the below mutation I am able to send the correct data to GraphQL. The problem arise when I try to query for data that includes settings (e.g. the response from this mutation). I get TypeError: Cannot read property 'selections' of null at writeSelectionSetToStore. It works if settings is null. It also works fine in the /graphql query app.

function mapMutationsToProps({ ownProps, state }) {
  return {
    updateClub: (variables) => ({
      mutation: gql`
        mutation updateClub(
          $uid: String!
          $name: String!
          $settings: JSON!
        ) {
          updateClub(
            uid: $uid
            name: $name
            settings: $settings
         ) {
            uid,
            name,
            settings
          }
        }
      `,
      variables: variables,
    })
  }
}

Any help would be greatly appreciated 😄 🌈

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
asbjornengecommented, May 14, 2016

@stubailo works like a charm! Thanks a bunch ❤️ 🌈 🚀

0reactions
stubailocommented, May 13, 2016

Published in NPM as 0.3.8, let me know if it works for you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

E2E Testing json-graphql-server using Cypress
This blog post explains how Cypress.io test runner can test an application that uses GraphQL to load / save data on the server....
Read more >
Custom scalars - Apollo GraphQL Docs
The serialize method converts the scalar's back-end representation to a JSON-compatible format so Apollo Server can include it in an operation response.
Read more >
Spring for GraphQL Documentation
To get started, check the Spring GraphQL starter on start.spring.io ... which works well since in GraphQL Java a subscription response is a ......
Read more >
Optimizing APIs by Design. REST, GraphQL, JSON:API, oh my!
REST, GraphQL, JSON:API, oh my! When creating an API to expose some ... As such, it enjoys really great compatibility and huge adoption....
Read more >
GraphQL.SystemTextJson 7.2.1 - NuGet
Test code Build artifacts Publish code CodeQL analysis codecov ... https://graphql.org/learn - learn about GraphQL, how it works, and how to use it....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found