1stdibs / relay-mock-network-layer

Relay modern network layer that returns schema correct mock data
MIT License
36 stars 9 forks source link

Update graphql-tools@4.0.2 #7

Closed damassi closed 6 years ago

damassi commented 6 years ago

While working on improving the DX error output in our tests noticed that graphql-tools is a few major versions behind (1.2.1 -> 4.0.2). This updates it to latest as well as allows users to pass the full option set along to makeExectuableSchema.

Example:

getNetworkLayer({
  schema,
  mocks: {
    FormattedNumber: () => FormattedNumber,
    ...mockResolvers,
  },
  resolverValidationOptions: {
    requireResolversForResolveType: true,
  },
  ...otherOptionsToPass
})

Testing it on our codebase required us to set requireResolversForResolveType: false in order for old behavior to be preserved as the default in graphql-tools is true, which is where we would like to get to. (See here for an explanation of the error we were receiving.) Not sure what the implications are for this far of a jump but here are some links to their release pages:

See https://github.com/artsy/reaction/pull/1465 for an example of what we're working towards surfacing.

damassi commented 6 years ago

Rebased with latest master

robrichard commented 6 years ago

@damassi apologies, but you will need to rebase this one more time.

damassi commented 6 years ago

Updated!