fix: stop pascal casing enums for MIS #931
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes
Codegen currently pascal cases enums defined in the GraphQL schema.
Gen 2 doesn't pascal case top-level enums:
generates:
This naming discrepancy hasn't caused problems yet because:
But we create a wrapper input type for all model generated queries. So the actual GraphQL mutation here uses CreateTodoInput + Variables and never mentions the
foo
type.This changes with the custom type / enum input for custom operation work in progress.
will generate a GraphQL query like:
because there isn’t a wrapper input type.
Note
This change only applies to the model introspection schema.
Codegenerated enums are still pascal cased because changing that will cause a breaking change if the schema defined enum casing doesn't match. Non-MIS consuming clients (e.g. native codegen) doesn't support custom operations, so the feature motivating this change doesn't apply.
Codegen Paramaters Changed or Added
Issue #, if available
N/A
Description of how you validated changes
Checklist
yarn test
passesRelevant documentation is changed or added (and PR referenced)Breaking changes to existing customers are released behind a feature flag or major version updateChanges are tested using sample applications for all relevant platforms (iOS/android/flutter/Javascript) that use the feature added/modifiedChanges are tested on windows. Some Node functions (such aspath
) behave differently on windows.type
,input
,enum
,interface
,union
and scalar types.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.