1

I have one more question. On my server I have something like:

extend type Query {
  login (input: LoginInput!): Response
}

On the client, I am trying to make the query:

query Login ($input: LoginInput!) {
  login (input: $input) {
    login @client
  }
}

I have a resolver:

const login = parent => {
  console.log (`parent`, parent)
}

and:

  resolvers: {Response: {login}}

So far so good.

The problem is - the resolver logs

{
  __typename: "Response"
}

I don't actually get the object (the Response). If I copy the function to the server, I get it. This behavior is the same for useQuery, useMutation, useLazyQuery. Furthermore, if I change login @client to success message, then I get both, so there's doesn't seem to be a typo.

Is there some gotcha that one has to keep in mind (I am not using async anywhere, assuming Apollo takes care of that), or should I submit an issue, because it looks like a bug?

Cheers!

Dominik Teiml
  • 505
  • 1
  • 4
  • 12

1 Answers1

1

The problem is pretty trivial - I'm not querying any fields!

Replace

login @client

by

success
message
login @client
Dominik Teiml
  • 505
  • 1
  • 4
  • 12