From b6e26d7bb3de8d6a0174a5bee066b29b42079ec8 Mon Sep 17 00:00:00 2001 From: copenri Date: Thu, 18 Dec 2025 13:29:37 -0500 Subject: [PATCH 1/2] Add documentation to showcase BigInt type support This change updates the documentation to include the BigInt type. --- docs/types/scalars.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/types/scalars.rst b/docs/types/scalars.rst index 2a55245d2..eed30f6a5 100644 --- a/docs/types/scalars.rst +++ b/docs/types/scalars.rst @@ -249,6 +249,32 @@ Graphene also provides custom scalars for common values: assert results.data == {"incrementEncodedId": "NQ=="} +``graphene.BigInt`` +^^^^^^^^^^^^^^^^^^^^ + + Represents a non-fractional signed whole numeric value not constrained + to 32-bits like the `Int` type. + +.. code:: python + + from graphene import Schema, ObjectType, BigInt + + class Query(ObjectType): + add_one_to = BigInt(required=True, big_int_input=BigInt(required=True)) + + def resolve_add_one_to(root, info, big_int_input): + assert big_int_input == 2**31 + return big_int_input + 1 + + schema = Schema(query=Query) + + results = schema.execute(""" + query { + addOneTo(bigIntInput: "2147483648") + } + """) + + assert results.data == {"addOneTo": 2**31 + 1} Custom scalars -------------- From 3aff5c2c6e11d5e17c10b8d72cd9da9403140a20 Mon Sep 17 00:00:00 2001 From: copenri Date: Thu, 18 Dec 2025 13:35:45 -0500 Subject: [PATCH 2/2] Fix formatting --- docs/types/scalars.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/types/scalars.rst b/docs/types/scalars.rst index eed30f6a5..121e80a26 100644 --- a/docs/types/scalars.rst +++ b/docs/types/scalars.rst @@ -253,7 +253,7 @@ Graphene also provides custom scalars for common values: ^^^^^^^^^^^^^^^^^^^^ Represents a non-fractional signed whole numeric value not constrained - to 32-bits like the `Int` type. + to 32-bits like the `Int` type. .. code:: python