question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

client:codegen --no-addTypename for SWIFT target

See original GitHub issue

Code generate --no-addTypename is not working for swift target. Any version <=2.13.1 has this issue. Apollo-iOS example can reproduce.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
theladyjayecommented, Feb 27, 2020

Version: apollo/2.24.0 darwin-x64 node-v10.16.3

I see the same issue. When __typename is present the GraphQL deserialization fails from my Apollo server with:

Failure! Error: GraphQLResultError(path:myMutation.__typename, underlying: Apollo.JSONDecodingError.missingValue)
apollo codegen:generate --target=swift --includes="./GraphQL/**/*.graphql" --localSchemaFile="schema.json" --no-addTypename Services/GraphQL

If I manually remove the

GraphQLField("__typename", type: .nonNull(.scalar(String.self))),

from the generated code things under public static let selections: [GraphQLSelection] = [

things start working again.

0reactions
abashyamcommented, Aug 23, 2020

The issue still exists. It doesn’t appear to be a tooling issue but more with the apollo-ios. Should it be logged somewhere else for visibility? I am happy to work with someone to resolve this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Codegen configuration - Apollo GraphQL Docs
Indicates that you would like to include the generated module directly in your application target. swiftPackageManager, Creates a schema module as an SPM ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found