Coder Social home page Coder Social logo

Comments (6)

xsc avatar xsc commented on June 9, 2024

world is a TextInput in your example, not a String, so the correct query should be (but I haven't run it):

{
  hello(world: {text: {value: "World"}})
}

So, the query is indeed invalid but the error message is a bit misleading.
(Or the schema/query you supplied is not the one that produced the error?)

from graphql-clj.

bjonica avatar bjonica commented on June 9, 2024

My mistake. Corrected the query to yours, but same problem.

{
  "errors": [
    {
      "error": "Argument 'world' of type 'WorldInput' has invalid value: {text: [:object-value {:value World}]}. Reason: Expected 'WorldInput', found not an object.",
      "loc": {
        "line": 2,
        "column": 16
      }
    }
  ]
}

from graphql-clj.

tendant avatar tendant commented on June 9, 2024

I am not sure whether nested input type are supposed to work or not.

Input Type is defined in GraphQL Spec:

GraphQL describes the types of data expected by query variables. Input types may be lists of another input type, or a non‐null variant of any other input type.

Variables can only be scalars, enums, input objects, or lists and non‐null variants of those types. These are known as input types. Objects, unions, and interfaces cannot be used as inputs.

from graphql-clj.

tendant avatar tendant commented on June 9, 2024

Just found this from type system definition:

An Input Object defines a set of input fields; the input fields are either scalars, enums, or other input objects. This allows arguments to accept arbitrarily complex structs.

Nested input type should be supported.

from graphql-clj.

tendant avatar tendant commented on June 9, 2024

Currently parser treats input values as object values which is incorrect.

We need enhance the parser and validator to support this case.

from graphql-clj.

tendant avatar tendant commented on June 9, 2024

This issue is fixed in latest version.

from graphql-clj.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.