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

support virtual properties through dedicated schema #55

Merged
merged 1 commit into from
Jun 17, 2018

Conversation

timhuff
Copy link
Collaborator

@timhuff timhuff commented Jun 16, 2018

This provides support for virtual properties, even with select filtering on. Not crazy about the API but the types need to be specified somewhere. I considered adding a boolean virtual property to the existing json schema props but I don't think that's compliant with the spec.

p.s. Sorry about the two other erroneous pull requests - in a bit of a rush.

@timhuff
Copy link
Collaborator Author

timhuff commented Jun 16, 2018

@nasushkov I feel this might be a good one to start on once you get some time. I realized after submitting it that I had possibly accidentally resolved #51 with it (or gotten close). But I think this will also be a good jumping off point for the discussion of "using objection model properties as GraphQL configurations - yay or nay?". It seems like it might be more palatable if we pick a single property (maybe graphqlConfig or something) and put everything in there.

@nasushkov
Copy link
Contributor

Hi @timhuff do you want to provide a fine-grained configuration with exact fields in the graphqlConfig or something more high level like:
graphqlConfig: { useSchema: true, useRelations: true, useVirtualProps: false, }
I think by default the schema should be generated with all options set to true and if you want to fine-tune your generated schema, you can configure the output with this extra field.

@nasushkov
Copy link
Contributor

@timhuff I think we can merge this for now and get back to a more general solution in the future

@timhuff
Copy link
Collaborator Author

timhuff commented Jun 17, 2018

@nasushkov Yea, I was thinking more along the lines of the high level example. But then the high level one would also have a virtualProps property (which I think could replace useVirtualProps). So something like graphqlConfig: { useSchema: true, useRelations: true, virtualProps: {fullName: {type: "string"}}}

@timhuff timhuff merged commit fd2f42b into Vincit:master Jun 17, 2018
timhuff added a commit that referenced this pull request Jun 18, 2018
This reverts commit fd2f42b, reversing
changes made to 6898d68.
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