Federation
See original GitHub issueI like what I’m seeing - I’m curious - I need to be able to add attributes for federation support
ie sample schema:
type Post @key(fields: "id") {
id: ID!
title: String!
content: String!
published: Boolean!
createdAt: String!
userId: Int
user: User
}
extend type Query {
posts: [Post!]!
post(id: ID!): Post
}
extend type User @key(fields: "id") {
id: ID! @external
posts: [Post]
}
Is this possible ?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Federation - Wikipedia
A federation is a political entity characterized by a union of partially self-governing provinces, states, or other regions under a central federal ...
Read more >Federation Definition & Meaning - Merriam-Webster
an encompassing political or societal entity formed by uniting smaller or more localized entities: such as ; a · a federal government ;...
Read more >Federation | Definition, Examples, Government, & Difference ...
federation, the government of a federal community. In such a model there are two levels of government, one dealing with the common and...
Read more >Federation Of American Scientists – Science for a safer, more ...
At the Federation of American Scientists, we are obsessed with outcomes, not just the myriad ways that science and technology can make the...
Read more >federation - Wiktionary
Act of joining together into a single political entity. · Array of nations or states that are unified under one central authority which...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@sgentile Example should work with next version
Thank you!
Question… and I probably overlooked this: Apply ‘extends’ and @key is great’ there is another use case with this - you can see this in the post schema:
This User type is not part of ‘Posts’ Prisma schema, however this is what links the above user model as shown here: https://github.com/sgentile/nest-apollo-federation/blob/main/posts-service/src/posts/schema.graphql
Just for reference this is then used in the resolver- ie.: @ResolveField(‘user’) getUser(@Parent() post: Post) { return { __typename: ‘User’, id: post.userId }; }