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

Custom Scalar type clashing a ApolloAPI type. #3258

Closed
215eight opened this issue Oct 18, 2023 · 1 comment · Fixed by apollographql/apollo-ios-dev#94
Closed

Custom Scalar type clashing a ApolloAPI type. #3258

215eight opened this issue Oct 18, 2023 · 1 comment · Fixed by apollographql/apollo-ios-dev#94
Assignees
Labels
bug Generally incorrect behavior needs investigation

Comments

@215eight
Copy link

Summary

There is a custom scalar defined in the schema called Object. The generated code creates a typealias called Object which clashes with the ApolloAPI.Object struct.

Is there a way to alias certain types?

Schema
scalar Object

Generated Code
public typealias Object = String

ApolloAPI Object type

public struct Object: Hashable {
  public init(
    typename: String,
    implementedInterfaces: [Interface]
  ) {
    self.typename = typename
    self.implementedInterfaces = implementedInterfaces
  }

Version

1.5.0

Steps to reproduce the behavior

  1. Create a schema with custom scalar named Object.

scalar Object

type Foo {
bar: Object
}

  1. Using the codegen cli, generate the schema using the schema file listed above
  2. Open the package / project with the auto-generated code
  3. Compile issue will occur due to having two types with the same name.

Logs

No response

Anything else?

No response

@BobaFetters
Copy link
Member

The fix for this has been merged in and will go out with our next release.

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

Successfully merging a pull request may close this issue.

2 participants