graphql

orestis 2019-06-20T07:41:54.019200Z

I’ve just upgraded to lacinia 0.3.3 and my schema is no longer valid. First of all, GREAT error messages 🙂 Here’s the offending thing:

:labels
       {:type ...,
        :description ...,
        :resolve #'nosco.graphql.resolvers.users/user-userlabels},
should satisfy

  fn?

or

  (fn
   [%]
   (satisfies?
    com.walmartlabs.lacinia.resolve/FieldResolver
    %))

orestis 2019-06-20T07:42:05.019500Z

Shouldn’t that be ifn? instead?

gklijs 2019-06-20T08:39:29.019600Z

There where some automatic conversions that no longer happen with the latest version. I used a number for id, and had to make it a string from the frontend. Not sure if that helps. But it's probably something similar with the schema, like a key to string needing an explicit (name x) or something.

orestis 2019-06-20T08:49:48.019800Z

You are referring to Scalars, right? My case is a plain resolver…

orestis 2019-06-20T09:04:27.020100Z

Filed here: https://github.com/walmartlabs/lacinia/issues/291

👍 1
xiongtx 2019-06-20T22:35:20.021600Z

Basic r.e. GraphQL / Lacinia: I often find myself wanting to do the following:

{:objects {:foo {:fields {:foo_1 {:type String
                                  :resolve :resolve-foo-1}}
                 :resolve :resolve-foo}}}
And directly querying like { foo { foo_1 } }. But this is invalid, and I always need:
{:objects {:foo {:fields {:foo_1 {:type String
                                  :resolve :resolve-foo-1}}}}
 :queries {:foo {:type :foo
                 :resolve :resolve-foo}}}
Is it always necessary to do it this way, or am I missing an easier option?

domkm 2019-06-20T23:14:51.023100Z

Could you give an example of what kind of objects you're creating and querying? Mostly, top level queries are things like "search for user" or "get list of projects".

domkm 2019-06-20T23:16:44.025Z

Your code reminds me slightly of the Node pattern (used in Relay) where most objects implement interface Node { id: ID! } and you have a top level query field that looks like node(id: ID!): Node for selecting specific nodes