Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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