abhiaiyer91 / apollo-storybook-decorator

Wrap your storybook environment with Apollo Client, provide mocks for isolated UI testing with GraphQL
332 stars 34 forks source link

Add 'addTypeName={false}' support #59

Open robinelvin opened 5 years ago

robinelvin commented 5 years ago

I may be doing something wrong or I've missed something in the documentation but when passing back mocked data through a nested Mutation component the objects have a __typename: "<type>" property and therefore do not match the schema.

As mentioned here the addTypeName option of the Apollo MockedProvider allows you to turn off the typename annotations. Is this possible to do with apollo-storybook-decorator?

abhiaiyer91 commented 5 years ago

hi @robinelvin, looks like we are defaulting to true here https://github.com/abhiaiyer91/apollo-storybook-decorator/blob/master/packages/apollo-storybook-core/src/index.js#L81

We can make this configurable. PRs are welcome!!