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

JSON Being Decoded As String #3458

Closed
rehatkathuria opened this issue Oct 11, 2024 · 1 comment
Closed

JSON Being Decoded As String #3458

rehatkathuria opened this issue Oct 11, 2024 · 1 comment
Labels
bug Generally incorrect behavior needs investigation

Comments

@rehatkathuria
Copy link

Summary

Apollo seems to be decoding types incorrectly; specifically a JSON type in my typeDefs is being decoded as a Swift.String on the client

Version

1.15.2

Steps to reproduce the behavior

  scalar DateTime
  scalar JSON

  type Notification {
    id: ID!
    created_at: DateTime!
    updated_at: DateTime!
    read: Boolean!
    read_at: DateTime
    user: User!
    sender: User!
    template: NotificationTemplate!
    params: JSON // This is the param that's being decoded incorrectly by Apollo
    link: String
  }
Apollo.GraphQLExecutionError(path: getNotifications.edges.0.node.params, underlying: ApolloAPI.JSONDecodingError.couldNotConvert(value: AnyHashable([AnyHashable("foo"): AnyHashable("bar")]), to: Swift.String))

Logs

No response

Anything else?

No response

@rehatkathuria rehatkathuria added bug Generally incorrect behavior needs investigation labels Oct 11, 2024
Copy link
Contributor

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.

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

No branches or pull requests

1 participant