tendant / graphql-clj

A Clojure library that provides GraphQL implementation.
Eclipse Public License 1.0
285 stars 22 forks source link

List type argument seems to become lost #53

Closed sibyl229 closed 7 years ago

sibyl229 commented 7 years ago

Hi,

It seems that the list type argument isn't passed to the resolver function now. I wonder if I made a mistake or there is some regression in the code.

Below is the schema and mutation call I was testing. The resolver function createPerson is called with args :friend nil (the :name argument is fine):

type Person {
  id: String!
  name: String
  friends: [Person]
}

type Mutation {
  createPerson(name: String, friends: [String]): Person
}

schema {
  mutation: Mutation
}
mutation {
  createPerson(name: "John", friends: ["1"]) {
    name,
    id,
    friends {
      name
    }
  }
}

I wonder if the args-fn needs to handle the list type. https://github.com/tendant/graphql-clj/blob/master/src/graphql_clj/executor.clj#L13-L17

Thank you! And just to take to opportunity to say that this is a great tool you are making. The well designed and easy to use API makes it more of a joy to code with. Thank you very much!

tendant commented 7 years ago

Thanks for reporting the issue.

This has been fixed in new version 0.2.1

tendant commented 7 years ago

Please try it using latest version 0.2.2. It has been fixed with test case:

https://github.com/tendant/graphql-clj/blob/0.2.2/test/graphql_clj/executor_test.clj#L589

Thanks again for reporting the issue.

sibyl229 commented 7 years ago

Thanks a lot @tendant ! version 0.2.2 works great for me!