How to set DataDefinition::create('integer') to allow bigint numbers
I do not believe there is a solution for this.

Typed Data Manager will always add the PrimitiveType validation constraint plugin for any primitive data type (data type implementing PrimitiveInterface). This plugin does not provide any options for the filter_var native PHP function, which is required to set max_range. This option itself must be less than the PHP_INT_MAX constant. Furthermore PHP_INT_MAX is signed and BIGINT is unsigned. 10 digits should be supported by PHP_INT_MAX for even 32-bit systems as long as it is below 2147483647, which is probably the case for your PHP build. You could try using a 64-bit version of PHP.

There are three alternatives given the signed/unsigned caveat above:


Create a Data Type plugin (that does not extend on PrimitiveInterface) to handle bigger integers.
Alter the constraint plugins and replace PrimitiveType with your own constraint plugin that allows for this or does its own logic. Hope that no other module will do this for the same plugin.
File a core issue and patch Drupal core so that Typed Data Manager allows to pass options and PrimitiveType plugin uses those options. This is trickier than it seems because those options would need to be a part of the DataDefinition (in a backwards-compatible API change), and then extracted out as options into the constraint.


My preferred way would be to get rid of PrimitiveType constraint altogether in Drupal 9 and use specific Symfony constraints.