aicers / review-web

A web interface to REview
Apache License 2.0
1 stars 2 forks source link

Introduce a custom GraphQL scalar for IP addresses #353

Open msk opened 1 week ago

msk commented 1 week ago

Currently, review-web is using the GraphQL String type to represent IP addresses in the schema. This requires manual validation and error handling in various queries and mutations to ensure that the provided IP addresses are valid.

I propose introducing a custom GraphQL scalar specifically designed for IP addresses. This would allow us to:

The custom scalar would be responsible for parsing and validating IP addresses, and could be implemented using the async-graphql ScalarType trait.

The implementation would involve creating a new custom scalar type, e.g. IpAddress, and updating the relevant parts of the schema to use this new type.