Skip to content

Changing argument type to a using a list of that same type should probably not be a breaking change #3705

@zmay2030

Description

@zmay2030

Hello,
As per GraphQL spec If the value passed as an input to a list type is not a list and not the null value, then the result of input coercion is a list of size one, where the single item value is the result of input coercion for the list’s item type on the provided value (note this may apply recursively for nested lists). See here for more info
Thus, if input argument changes from A to [A] for a field in schema, then the client will not break because per GraphQL spec, it is expected that sending the type as is will turn it into a list with length 1.
So if say the OLD schema is:

type Query {
    foo(arg: String)
}

And the NEW schema is:

type Query {
    foo(arg: [String])
}

The below query will still work for both OLD and NEW schemas:

query {
   foo(arg: "foooo")
}

I therefore think this should not be a breaking change, but it seems like it is.

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