I've modified the example found in the example directory, here's what I've done:
A post can be written by several authors, so in order to manage different authors per post and different posts per author I've created a link service that will centralize the modification of these links and allow a many-to-many relationship and avoid synchronization problems when adding or deleting authors and/or posts.
In this case, the schema will simply extend the existing schemas and allow you to obtain the list and number of posts per author and the list and number of authors per post.
Here's the schema:
type Post @key(fields: "pid") @extends {
pid: ID! @external
title: String @external
authors: [User]
numberOfAuthors: Int @requires(fields: "pid title")
}
type User @key(fields: "id") @extends {
id: ID! @external
name: String @external
posts: [Post]
numberOfPosts: Int @requires(fields: "id name")
}
Hello,
I have an error on array of type extended.
I've modified the example found in the example directory, here's what I've done:
A post can be written by several authors, so in order to manage different authors per post and different posts per author I've created a link service that will centralize the modification of these links and allow a many-to-many relationship and avoid synchronization problems when adding or deleting authors and/or posts.
It has a database in format:
In this case, the schema will simply extend the existing schemas and allow you to obtain the list and number of posts per author and the list and number of authors per post.
Here's the schema:
and here's the associated resolver:
However, when I run the following query :
I get the result:
And the following log:
And if I run the query :
I get the result:
And the following log:
Here's the code that reproduces this error: https://github.com/Drilmo/mercurius-gateway And run "exemple-2" to reproduce error