Skip to content

Using variables in scalars #1011

Open
Open
@cutsoy

Description

@cutsoy

I would like some clarification on using variables in scalars.

Given the following schema:

scalar Custom

type Query {
    hello(custom: Custom!): String!
}

We know that the following query could be valid (depending on Custom's wire format):

query Example {
    hello(custom: { name: "Tim" })
}

Would the following example also be valid?

query Example($name: String!) {
    hello(custom: { name: $name })
}

If so, does the executor first resolve $name and then call the scalar's deserializer with { name: "Tim" }?

Can someone shed some light on this?

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