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

Undeprecate schemaFile #6055

Merged
merged 1 commit into from
Jul 15, 2024
Merged

Undeprecate schemaFile #6055

merged 1 commit into from
Jul 15, 2024

Conversation

martinbonnin
Copy link
Contributor

I changed my mind. There is a global expectation that there is a "main" schema file. Furthermore, deprecating this also had cascading impacts on introspection {} for which we don't have a good answer right now.

@martinbonnin martinbonnin requested a review from BoD as a code owner July 15, 2024 11:29
Copy link

netlify bot commented Jul 15, 2024

Deploy Preview for apollo-android-docs canceled.

Name Link
🔨 Latest commit 253e959
🔍 Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/669508012c620e0008ac7544

Copy link
Contributor

@BoD BoD left a comment

Choose a reason for hiding this comment

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

👍

@martinbonnin
Copy link
Contributor Author

martinbonnin commented Jul 15, 2024

Drawback: using schemaFile.set() ignores any extra.graphqls file.

@martinbonnin
Copy link
Contributor Author

using schemaFile.set() ignores any extra.graphqls file

I just checked 3.x and it's already the case so let's err on the conservative side and keep things as is for the time being.

The current logic is:

  1. files are auto-detected from src/main/graphql
  2. srcDir overrides that you to look into other directories
  3. schemaFiles overrides srcDir for schema files
  4. Service.schemaFile overrides schemaFiles
  5. introspection {} uses the result of the above
    a. unless there are multiple schema files found
    a. or Instrospection.schemaFile is set itself

Long term I think we'd want only 2 modes:

  1. simple: just use what's in src/main|commonMain/graphql
  2. advanced:
    a. specify .graphql files with graphqlFiles(FileCollection)
    a. specify .graphqls files with schemaFiles(FileCollection)
    a. introspection is dumb and requires outputFile to be set explicitely.

@martinbonnin martinbonnin merged commit f4c829b into main Jul 15, 2024
9 checks passed
@martinbonnin martinbonnin deleted the undeprecate-schemaFile branch July 15, 2024 13:55
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