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

GET option for ApolloSchemaDownloader #1981

Closed
mikepitre opened this issue Oct 5, 2021 · 9 comments · Fixed by #2010
Closed

GET option for ApolloSchemaDownloader #1981

mikepitre opened this issue Oct 5, 2021 · 9 comments · Fixed by #2010
Assignees
Labels
feature New addition or enhancement to existing solutions swift-scripting

Comments

@mikepitre
Copy link
Contributor

mikepitre commented Oct 5, 2021

Feature request

It would be great if we had an option to use a GET http method for schema downloading/introspection as part of the ApolloCodegenLib.

Motivation

A 3rd party CMS we're using only supports GET requests against their GraphQL API. They expect a GET request and the IntrospectionQuery passed as a query param.

@designatednerd
Copy link
Contributor

Out of sheer curiosity, what CMS is it?

@mikepitre
Copy link
Contributor Author

haha np, it's Prismic

@designatednerd designatednerd added feature New addition or enhancement to existing solutions swift-scripting labels Oct 5, 2021
@AnthonyMDev
Copy link
Contributor

@calvincestari Are you going to be able to support this with the changes you are making for the new codegen schema downloader currently?

@calvincestari
Copy link
Member

Yes I believe so. If there are a few minor conflicts I'm expecting they'll be easy enough to fix up. I'll look at getting this into the next release.

@mikepitre have you done any proof-of-concept work trying to get this working?

@mikepitre
Copy link
Contributor Author

mikepitre commented Oct 27, 2021

@calvincestari I have it working, but I just have a quick and dirty implementation for now. I essentially extended ApolloSchemaDownloader and copied the downloadViaIntrospection function from the package into a new downloadViaIntrospectionGET function that just sets the httpMethod of the url request to GET and passes the introspection query as a param

@calvincestari
Copy link
Member

Do you want to have a go at cleaning it up and submitting a PR? I believe it's just the request, as you mentioned, that needs to change. Working it nicely into the existing schema downloader API without simply adding another method is the trickier bit.

@mikepitre
Copy link
Contributor Author

mikepitre commented Oct 28, 2021

@calvincestari I have a rough PR I can submit, but unfortunately I don't have much time to commit to this at the moment. I can submit it as a draft if you'd like but I'm afraid I can't spend much more time on this for now.

#2010

@calvincestari
Copy link
Member

@mikepitre - this is now merged. Thanks for contribution! We'll get it out in the next release which should happen in the next week or so.

@mikepitre
Copy link
Contributor Author

@calvincestari great! Thanks for your help and sorry I couldn't dedicate more time to this at the moment. I really like the modifications you made!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New addition or enhancement to existing solutions swift-scripting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants