graphitation
graphitation copied to clipboard
RelayPayloadMockGenerator doesn't support nested lists
RelayPayloadMockGenerator doesn't produce a correct output for nested lists. This is a regression for graphql-js-operation-payload-generator
package compared to v0.8.5.
How to reproduce
- Add a nested list type to the schema
node_modules/relay-test-utils-internal/lib/testschema.graphql
type Query {
## Other root fields
nestedList(id: ID!): [[Node!]!]!
}
-
Generate new schema types for tests:
yarn test:schema-types
-
Add a test case:
test("generate mock for nested list", () => {
testGeneratedData(graphql`
query RelayMockPayloadGeneratorNestedListTestQuery {
nestedList(id: "my-nested-list-id") {
__typename
id
}
}
`);
});
Expected result: test passes.
Actual result: test fails with GraphQLError: Expected Iterable, but did not find one for field "Query.nestedList"
.