graphql-relay-tools icon indicating copy to clipboard operation
graphql-relay-tools copied to clipboard

Make edges and edge type non-nullable

Open janmeier opened this issue 4 years ago • 1 comments

I'd like to generate a schema like this:

type Connection {
  edges: [Edge!]!
  pageInfo: PageInfo!
}

Specifying that edges will never be null, and that the array will never contain nulls. We are generating reasonml types from our graphql schema, so it would be very nice to not have to handle nulls at all, and know that the server will always return an array for edges.

This could be an option to connectionDefinitions, in order not to break backwards compat.

WDYT? I can create a PR if this sounds like something you would like to support?

janmeier avatar Jun 25 '20 08:06 janmeier

Alas this isn't what the spec says, a few years ago I tried getting the spec changed but it might be too late to do that now

orta avatar Oct 18 '20 14:10 orta