Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Subscriptions using id_IN operator parse uuids as integers #5586

Closed
adley-kim opened this issue Sep 22, 2024 · 1 comment · Fixed by #5590
Closed

Subscriptions using id_IN operator parse uuids as integers #5586

adley-kim opened this issue Sep 22, 2024 · 1 comment · Fixed by #5590
Labels
bug Something isn't working confirmed Confirmed bug

Comments

@adley-kim
Copy link

Describe the bug
Executing a subscription with the variables {where: {id_IN: myUuidList }} throws the following error:

Internal error occurred during message handling. Please check your implementation. Neo4jError: number format error: interior "-" character: 7fab55b1-6cd2-489d-92ca-f4944478d127
at new Neo4jError (C:\...\neo4j-driver-core\lib\error.js:75:16)   
    at newError (C:\...\neo4j-driver-core\lib\error.js:111:12)        
    at Integer.fromString (C:\...\neo4j-driver-core\lib\integer.js:743:40)
    at Integer.fromValue (C:\...\neo4j-driver-core\lib\integer.js:792:28)
    at isFloatOrStringOrIDAsString (C:\...\@neo4j\graphql\dist\schema\resolvers\subscriptions\where\filters\filter-by-properties.js:66:68)
    at IN (C:\...\@neo4j\graphql\dist\schema\resolvers\subscriptions\where\filters\filter-by-properties.js:85:13)
    at filterByProperties (C:\...\@neo4j\graphql\dist\schema\resolvers\subscriptions\where\filters\filter-by-properties.js:56:18)
    at subscriptionWhere (C:\...\@neo4j\graphql\dist\schema\resolvers\subscriptions\where\where.js:36:62)
    at C:\...\@neo4j\graphql\dist\schema\resolvers\subscriptions\subscribe.js:61:51
    at C:\...\@neo4j\graphql\dist\schema\resolvers\subscriptions\filter-async-iterator.js:50:33 {
  constructor: [Function: Neo4jError] { isRetriable: [Function (anonymous)] },
  code: 'N/A',
  retriable: false
}

Type definitions

type Entity {
  id: ID! @id @unique
  name: String
}

To Reproduce
Steps to reproduce the behavior:

Using the previously defined Entity type, execute the following subscription:

const ENTITY_UPDATED = gql`subscription EntityUpdated($where: EntitySubscriptionWhere) {
    entityUpdated(where: $where) {
      updatedEntity {
        id
        name
      }
      event
      timestamp
      previousState {
        id
        name
      }
    }
  }
`;

const watchEntityIds = ["7fab55b1-6cd2-489d-92ca-f4944478d127"];

const result = useSubscription(ENTITY_UPDATED, {
    variables: {
      where: { id_IN: watchEntityIds },
    },
  });

Expected behavior

Subscription should return updates for entities with ids in watchEntityIds.

System (please complete the following information):

  • OS: Windows
  • Versions: @neo4j/graphql@5.6.2
  • Node.js version: v18.17.0

Additional context
Queries using the same parameters execute correctly.

Example:

const GET_ENTITIES = gql`
  query Entities($where: EntityWhere) {
    entities(where: $where) {
      id
      name
    }
  }
`;

const watchEntityIds = ["7fab55b1-6cd2-489d-92ca-f4944478d127"];


// this executes correctly!
const result = useQuery(ENTITY_UPDATED, {
    variables: {
      where: { id_IN: watchEntityIds },
    },
  });
@adley-kim adley-kim added the bug Something isn't working label Sep 22, 2024
@angrykoala angrykoala added the confirmed Confirmed bug label Sep 24, 2024
@neo4j-team-graphql
Copy link
Collaborator

We've been able to confirm this bug using the steps to reproduce that you provided - many thanks @adley-kim! 🙏 We will now prioritise the bug and address it appropriately.

@angrykoala angrykoala linked a pull request Sep 24, 2024 that will close this issue
This was referenced Sep 23, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working confirmed Confirmed bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants