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

Expose tags, original operation and preprocessing data #303

Merged
merged 1 commit into from Mar 3, 2021

Conversation

dotansimha
Copy link
Collaborator

@dotansimha dotansimha commented Feb 7, 2020

Hi :)

I'm working on a tool that uses openapi-to-graphql internally, and I needed a few minor changes in the source code:

  • Expose tags from source OAS as part of the operations. This is useful because other OAS tools uses tags.
  • Expose the raw OAS operation object.
  • Allow access to the preprocessing (IR) object to make it simple to access data.

As a side note, a few points to improvement:

  • I think this tool should leverage GraphQL extensions feature (Add 'extensions' to all Type System objects graphql/graphql-js#2097) and keep the OAS metadata as part of the created schema. It will make it simpler to get the source OAS object (instead of trying to guess it from the operation name or field names).
  • I understand that adding compiled lib to the repo allow developers to be able to install this tool directly from GitHub, but it also causes issues with rebases and merge changed - maybe it could be better to publish alpha version per each commit (we are doing something similar in graphql-code-generator repo) instead?

Thank you for this tool, it's really helpful, and it's approach really simplifies the integration between GraphQL and OAS :)

@Alan-Cha
Copy link
Collaborator

@dotansimha Sorry for the late reply but thank you so much for this PR! I like these changes! I think exposing the preprocessing object and the extensions idea would greatly boost usability. I'm not entirely sure if we should expose everything in the preprocessing object, however. I will have to take another look.

Yeah, we aren't exactly sure how we should present the code on GitHub and in our NPM package. We're open to any advice. I will take a look at your repo! It seems like an interesting idea.

All in all, thank you so much for contributing and your kind compliments! Hope you continue using OtG in the future!

Signed-off-by: Dotan Simha <dotansimha@gmail.com>
@Alan-Cha
Copy link
Collaborator

Alan-Cha commented Mar 3, 2021

@dotansimha I really dropped the ball on this one. It's been over an entire year. I had a really hectic year last year that prevented me from working on OtG as consistently as I wanted to and I just forgot to follow up. It's not really an excuse but it's the best I can come up with. I'm really sorry about that. Hope you were still able to use OtG and thanks for the contribution!

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.

None yet

2 participants