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

Remove dependency on apollo CLI for fetching schema #1935

Merged
merged 49 commits into from
Sep 16, 2021

Conversation

calvincestari
Copy link
Member

@calvincestari calvincestari commented Sep 10, 2021

This change removes a dependency on the Apollo CLI for schema downloading. Schema downloads are now Swift-based and maintainable/extensible within apollo-ios.

Notable changes:

  • Abstracted URLDownloader from CLIDownloader; used in both CLI and schema downloading. CLI downloading will be removed along with the Swift codegen implementation.
  • Registry schema requests are done via UntypedGraphQLRequestBodyCreator - a non-type-safe request creator to facilitate sending requests not using code generation.
  • Refactored ApolloSchemaOptions
    • Renamed to ApolloSchemaDownloadConfiguration for a more specific naming context.
    • Schema output is always SDL.
    • Defaults to the current registry variant.
  • Renamed ApolloSchemaDownloader APIs
    • fetch(with:) is more expressive than run(options:).

Closes #1823

designatednerd and others added 30 commits September 10, 2021 16:19
…request"

This reverts commit 9aac6367a611260ffea12e3b0ae965b999d9b9d3.
I tried pulling some of this stuff into Core but you have to pull so much into core to make it work since by default it uses a bunch of `Apollo` only types that it kind of defeats the point of keeping core small, and realistically the only place where we even *should* be using untyped queries is in grabbing the schema.
…o an actual schema rather than just being json
@hwillson hwillson removed this from the Release 1.0 milestone Sep 13, 2021
@calvincestari calvincestari marked this pull request as ready for review September 15, 2021 04:37
@calvincestari calvincestari changed the title Update/direct schema fetch Remove dependency on apollo CLI for fetching schema Sep 15, 2021
Copy link
Contributor

@AnthonyMDev AnthonyMDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on this! So glad to have this finished, and it looks great. Just a couple of suggestions.

One question: Do you know why the bundled ApolloCodegenFrontend.bundle.js changed? Did we need to make changes to the js library?

@designatednerd
Copy link
Contributor

designatednerd commented Sep 15, 2021

Do you know why the bundled ApolloCodegenFrontend.bundle.js changed? Did we need to make changes to the js library?

Yeah there was one method I had to expose for moving between JSON and SDL - I'm not quite seeing where the actual code went, though. Not sure if it got eaten in a merge or what

@calvincestari
Copy link
Member Author

Do you know why the bundled ApolloCodegenFrontend.bundle.js changed? Did we need to make changes to the js library?

Yeah there was one method I had to expose for moving between JSON and SDL - I'm not quite seeing where the actual code went, though. Not sure if it got eaten in a merge or what

This is the exact diff - e.printSchema=function e(t){return e()},. Goes together with this and this.

Copy link
Contributor

@AnthonyMDev AnthonyMDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@designatednerd designatednerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question re testing, otherwise this is :shipit:

@calvincestari calvincestari merged commit 22e2097 into main Sep 16, 2021
@calvincestari calvincestari deleted the update/direct-schema-fetch branch September 16, 2021 04:18
@hwillson hwillson added this to the Release 0.49.0 milestone Sep 16, 2021
@calvincestari calvincestari mentioned this pull request Sep 20, 2021
13 tasks
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.

Remove dependency on apollo CLI for fetching schema
4 participants