Skip to content

Make required fields required; to-one relations don’t need arguments#15

Open
mattleff wants to merge 2 commits intoVincit:masterfrom
SimpleUpdates:required-fields-required
Open

Make required fields required; to-one relations don’t need arguments#15
mattleff wants to merge 2 commits intoVincit:masterfrom
SimpleUpdates:required-fields-required

Conversation

@mattleff
Copy link
Contributor

@mattleff mattleff commented Aug 1, 2017

This makes the types generated more accurate:

type Review {
  id: Int
  title: String
  stars: Int
  text: String
  reviewerId: Int!
  movieId: Int!
  reviewer: Person!
  movie: Movie!
}

@koskimas
Copy link
Collaborator

koskimas commented Aug 2, 2017

Does this make any sense? If a property is needed when creating or updating a model it doesn't necessarily mean that it needs to be selected when querying? That's what json schema is in objection: an input validation schema and nothing else. Or is that what required means in graphql (I have never used it)?

@mattleff
Copy link
Contributor Author

mattleff commented Aug 2, 2017

@koskimas As the spec explains:

Fields are always optional within the context of a query, a field may be omitted and the query is still valid. However fields that return Non‐Null types will never return the value null if queried.

So, I'm not quite using the correct term. This should be called Make required fields non-null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments