-
Notifications
You must be signed in to change notification settings - Fork 287
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
encoding: Add graphql schemas support #1736
Comments
glad this is being thought about. I was thinking about this aspect a few days ago. |
I suspect you will have to create a proposal for this. Here are some things to think about while devising what this would look like and help others to know the scope of this feature.
A good place to start is by creating input / output pairs to show what the codec would produce |
my first approach is to use #definitions for cusom types, and possibly top declarations for queries and mutations. #customType2: { #CustomType: { would be encoded to type customType2 { type CustomType: { |
How would you handle the Conversely, there are valid CUE expressions which are hard to translate
What should happen in the above cases? A couple of suggestions:
|
I would argue, that a solution to codegen GraphQL queries/mutations ought to be similar to generating routes / paths in OpenAPI, and perhaps even member functions when generating types in programming languages? It is unclear to me if
|
I'd strongly recommend this approach.
Of course. I've seen many projects that accepted integrations into their repo, slowly drowning under the weight of the maintenance overheads for those integrations. It's not uncommon for integrations to be donated with good intentions but then the author's attention is diverted elsewhere. The project is then left to carry the dead weight.
Perhaps "does a majority of the core team want to own long-term development of this integration, and would doing so bring benefits to the rest of the core?"
Perhaps graphql could serve as an example by being developed in a separate repo but with input from the cue team to help establish those patterns / concepts which could act as a model for other integrations. |
Thanks for raising the issue, @qequ. I don't really have anything to add to the excellent comments above from @verdverm and @timbunce. So I'll just quote some of their points and add a couple of comments.
👍. This also helps others to understand the scope of what's being planned, how someone would hold and use such a feature.
👍. It should be possible to experiment with support for different encodings outside of the core repo. If you are running into problems in this respect, please raise an issue.
I think answers to this sort of question (and those that followed it) will become clearer the more closely we look at what an actual design for GraphQL support would look like. So, yet another reason to experiment and iterate.
Our current thinking is that there should probably be some ground in between "core" and "3rd party". Much like the
Possibly, and thank you for raising this concern ❤️. Alternatively, it forces us to think about better models of ownership and delegation within the CUE project, which is to my mind a better long term goal for everyone involved, and the project itself. This applies to whether something is core, and
We would be delighted to participate in any such design exploration. Furthermore, to ensure that the Go API, tools etc fully support people in doing that. Indeed as both @verdverm and @timbunce have suggested, providing an example to people of how a decision/design/proposal was reached after collaborative discussion etc would be a valuable contribution in and of itself, regardless of the outcome. |
@verdverm @timbunce @myitcv thank you all for the comments 😁 👍 So in summary, Should this code generator of graphql be developed like a standalone tool using CUE as an API instead of a core encoder of the language? @myitcv how would be treated as an @verdverm you have mentioned using Go API, do you have any examples of usage of GO API? |
It's a reference to how we determine the best home for the resulting code.
I was making reference to the fact we might have such a concept in the CUE world. But it's not something we need to worry about now. As @verdverm suggested, I would start by writing out some GraphQL and CUE, and showing the mapping between the two. |
Is your feature request related to a problem? Please describe.
Missing capability for converting CUE programs to valid graphql schemas
Describe the solution you'd like
Add a package to encode graphql, update CLI capabilities to be able to export;
cue export *.cue graphql:namefile.graphqls
Describe alternatives you've considered
Additional context
I will work on this feature so please assign it to me 👍
The text was updated successfully, but these errors were encountered: