2

If I want to use interface/implements without any arguments, how would I do that?

My current code looks like this:

interface User {
   GUID: String
   name: String
   age: Int
}

type FacebookUser implements User

type GoogleUser implements User

The reason I'm doing it like this, is to handle FacebookUsers age getting and GoogleUsers age getting different in the Resolvers-function. And if they aren't asking for age, I don't want to get them at all.

If I add this, it works:

interface User {
   GUID: String
   name: String
   age: Int
}

type FacebookUser implements User {
   bogus: String
}

type GoogleUser implements User {
   bogus: String
}

But there is nothing that separates the users except their underlying system, so I don't want to add specific fields to them.

I'm using Apollo GraphQL Tools 3.0.2

user2687506
  • 789
  • 6
  • 21
  • I think that object types without fields and brackets are very new and not in the spec yet. Have you tried using simply `{}`? – Herku Jun 14 '18 at 21:30

0 Answers0