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

Check type name conflicts in SelectionSet #3009

Merged
merged 6 commits into from
May 15, 2023

Conversation

BobaFetters
Copy link
Member

Adding validation to check for type name conflicts in selection set fields based on pluralization.

Closes #2850

Adding validation to check for type name conflicts in selection set fields based on pluralization.
@netlify
Copy link

netlify bot commented May 12, 2023

Deploy Preview for apollo-ios-docs canceled.

Name Link
🔨 Latest commit a1e19b3
🔍 Latest deploy log https://app.netlify.com/sites/apollo-ios-docs/deploys/6462b232830c850008b6529a

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.

This is awesome! I'd just like to add the operation/fragment name to the validation error and add a test for merged selections.

Sources/ApolloCodegenLib/ApolloCodegen.swift Outdated Show resolved Hide resolved
Sources/ApolloCodegenLib/ApolloCodegen.swift Outdated Show resolved Hide resolved
Sources/ApolloCodegenLib/ApolloCodegen.swift Outdated Show resolved Hide resolved
Sources/ApolloCodegenLib/ApolloCodegen.swift Outdated Show resolved Hide resolved
Sources/ApolloCodegenLib/ApolloCodegen.swift Outdated Show resolved Hide resolved
@calvincestari calvincestari mentioned this pull request May 15, 2023
7 tasks
- Moved extension methods from `SelectionSetTemplate` to new `IR+Formatting.swift` file
- Updated algorithm to loop through and check nested fragments for merged field conflicts
- Added field to `typeNameConflict` error to be able to display the operation/fragment that contains the error
- Minor code cleanup
@BobaFetters BobaFetters requested a review from AnthonyMDev May 15, 2023 13:43
@BobaFetters BobaFetters dismissed AnthonyMDev’s stale review May 15, 2023 16:04

Feedback addressed in latest update to PR

@calvincestari calvincestari mentioned this pull request May 15, 2023
7 tasks
- Added a few more tests
- Added a troubleshooting page to further explain this issue.
@calvincestari calvincestari merged commit 415f7fe into main May 15, 2023
@calvincestari calvincestari deleted the fix/conflicting-type-field-names branch May 15, 2023 22:46
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.

Generates conflicting types for fields of singular and plural names
3 participants