Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Positive, Negative constraints to be used with String scalar type #56

Copy link
Copy link
@pkonyves

Description

@pkonyves
Issue body actions

We have a use-case where we define numeric values as String scalar in the graphql schema. the reason for that is not to loose precision for fractions. We use them effectively as BigDecimal.

The problem with this is that we cannot use Positive, Negative and other constraints as they are only applicable on numeric values.

I tested locally and looking at the code AbstractPositiveNegativeConstraint could easily handle String scalar type by code: AbstractDirectiveConstraint#asBigDecimal() can cope with String.

The only thing would need to be changed is adding String to AbstractPositiveNegativeConstraint#getApplicableTypes

We could use BigDecimal scalar unit in our schema, but we'd like to avoid forcing our client to set up extra configuration on their side of graphql code generation

Would it be ok if I create such pull request to support String generally for all numeric kind of constraints?

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.