-
Notifications
You must be signed in to change notification settings - Fork 731
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
Generate local cache mutations #2311
Conversation
…utation directive
… from OperationDefinitionTemplate
# Conflicts: # Apollo.xcodeproj/project.pbxproj # Sources/ApolloAPI/LocalCacheMutation.swift
# Conflicts: # Sources/ApolloAPI/LocalCacheMutation.swift
✅ Deploy Preview for apollo-ios-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
dfec4ec
to
865de2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a comment re. this in one of the TS test files but we need to consider the implication of stripping things from the query string on Operation Safelisting. I feel like it may force us to implement the safelisting logic in apollo-ios because our client is the only one that would understand the local-only directives.
Sources/ApolloCodegenLib/Frontend/JavaScript/src/__tests__/sourceDefinitionTransformTests.ts
Show resolved
Hide resolved
Sources/ApolloCodegenLib/Templates/LocalCacheMutationDefinitionTemplate.swift
Outdated
Show resolved
Hide resolved
Tests/ApolloCodegenTests/CodeGeneration/FileGenerators/FragmentFileGeneratorTests.swift
Outdated
Show resolved
Hide resolved
Tests/ApolloCodegenTests/CodeGeneration/Templates/OperationDefinitionTemplateTests.swift
Show resolved
Hide resolved
5d040a8
to
0be4705
Compare
Generate Local Cache Mutation Templates!
Also needed to strip the
@apollo_client_ios_localCacheMutation
directive from the definition we send in the network request. While doing that, I did some clean up to the code that adds the__typename
field. This way we just make one pass to convert the client definition into one suitable for sending to the server. Also added tests for that!