10000 from_global_id() differs from reference implementation · Issue #39 · graphql-python/graphql-relay-py · GitHub
[go: up one dir, main page]

Skip to content
from_global_id() differs from reference implementation #39
Closed
@markedwards

Description

@markedwards

The python from_global_id does not exhibit the same behavior as the reference TypeScript implementation when handling invalid input.

Examples:

  • from_global_id("invalid") raises binascii.Error
  • from_global_id("") raises TypeError
  • from_global_id(b64encode(b"foo")) raises TypeError

In the first two cases, the reference implementation returns {type: "", id: ""}. In the third case, it returns {type: "", id: "foo"}. In no case does it throw an error.

This might seem like nitpicking, but it can cause significant differences in how user input ends up being handled.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0