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

How to use selectionSetInitializers? #2963

Closed
DasserBasyouni opened this issue Apr 17, 2023 · 3 comments
Closed

How to use selectionSetInitializers? #2963

DasserBasyouni opened this issue Apr 17, 2023 · 3 comments
Labels
bug Generally incorrect behavior docs Focuses on documentation changes

Comments

@DasserBasyouni
Copy link

DasserBasyouni commented Apr 17, 2023

I am not sure about how to use selectionSetInitializers, I searched every where but was not able to generate the initializers. Even the documentation is broken. I have also tried add it within options in apollo-codegen-config.json like below code then generate and fetch the scheme via apollo-ios-cli generate --fetch-schema but there is inits have been generated still.

I am not sure if I am missing any requirements for the selectionSetInitializers. I have just tried the code below.

"options": {
    "selectionSetInitializers" : {
      "operations": true,
      "namedFragments": true,
      "localCacheMutations" : true,
      "definitionsNamed": [
        "GetSampleSchemeWithCard",
        "ExerciseDetails"
      ]
    },
    "deprecatedEnumCases": "include",
    "schemaDocumentation": "include",
    "warningsOnDeprecatedUsage": "include",
    "conversionStrategies": {
      "enumCases": "camelCase"
    },
    "pruneGeneratedFiles": true
  }

Available initializers
image

Used Versions

  • apollo-ios-cli: latest (main branch)
  • Apollo-iOS: 1.0.7

Thanks in advance!

@DasserBasyouni DasserBasyouni added the question Issues that have a question which should be addressed label Apr 17, 2023
@AnthonyMDev
Copy link
Contributor

These are available as of version 1.1.0, it says your using 1.0.7. Please update to the newest release, re-install the codegen CLI and try running code generation again. Your config looks correct to me!

Something is going wrong with our documentation generator, and I haven't had time to determine what it is yet. Thanks for the heads up there.

@calvincestari calvincestari added bug Generally incorrect behavior docs Focuses on documentation changes and removed question Issues that have a question which should be addressed labels Apr 17, 2023
@DasserBasyouni
Copy link
Author

Thank you @AnthonyMDev, it's working now 🙏.

@calvincestari
Copy link
Member

Glad it's working for you @DasserBasyouni. I'm going to close this issue in favour of another focused on fixing the API documentation - #2966.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Generally incorrect behavior docs Focuses on documentation changes
Projects
None yet
Development

No branches or pull requests

3 participants