tendant / graphql-clj

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

Validator error: "clojure.spec$nilable_impl$reify__41165 cannot be cast to clojure.lang.Named" #43

Closed tendant closed 7 years ago

tendant commented 7 years ago
(def type-schema (validator/validate-schema (parser/parse "type Query {
  people: String
}

type Mutation {
  createPeople(emails: [String!]): String
}

schema {
  query: Query
  mutation: Mutation
}")))
(validator/validate-statement (parser/parse "mutation($emails: [String!]) {
  createPeople(emails: $emails)
}") type-schema)
{:state {:errors [{:error "clojure.spec$nilable_impl$reify__41165 cannot be cast to clojure.lang.Named"}]}}
aew commented 7 years ago

This appears to be happening because two clojure specs generated from [String!] are not equal to one another (they use object identity instead of value identity). I will think more about how we solve this, as the solution is not immediately obvious.

tendant commented 7 years ago

Thanks. Fix has been released in 0.1.20.