If i have an interface like: ``` interface SomeInt...
# prisma-whats-new
w
If i have an interface like:
Copy code
interface SomeInterface {
  id: ID! @isUnique
  users: [User!]! @relation(name: "SomeRelationOnUser")
  isPuplished: Bool! @defaultValue(value: false)
}
… and a type which implements this interface:
Copy code
type SomeType implements SomeInterface {
  id: ID!
  users: [User!]!
  isPublished: Bool!
}
… should I repeat all those
@isUnique
,
@defaultValue
and
@relation
in the type declaration or it will be inherited from interface?
a
Interfaces are not supported yet with Graphcool
w
@agartha OK, thanks. Where can I see all the supported and unsupported features of GraphQL?
@agartha Here is written that interfaces are supported by Graphcool: https://www.graph.cool/docs/faq/graphql-sdl-schema-definition-language-kr84dktnp0/ Are you sure they are not supported?
j
GraphQL is the specification. Graphcool is what you use to build your APIS with effortless. Being said this, this article explains what is GraphQL Schema Definition Language.
w
@jferrettiboke But you can see that every GraphQL type you use within Graphcool becomes
type YourTypeName implements Node
.
Node
is interface, so Graphcool is supporting interfaces at least internally. Where can I read which pieces of GraphQL specification are supported by Graphcool and which aren’t?
j
That’s correct. The only interface available is
Node
and is declared internally to take control about declaring the minimum fields on each
type
. At the moment,
id
field is the only obligatory field but a while ago
createdAt
and
updatedAt
were obligatory too.
Sorry, but I don’t know if there is a post explaining all the supported and unsupported features.
So, interfaces are not supported on Graphcool in order to be used by developers like us. The core team is working hard on this. There is an issue on GitHub which you can read and expose your own use cases. They could find your feedback very useful.
w
@jferrettiboke Thank you very much for explanation. And one more question: are union types and enums supported by Graphcool?
j
I am not sure 100% but I think
union
is not supported.
You're welcome! 🙂
a
There's full support for enum, not for
union
and
interface