-
-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Apollo Federation #351
Comments
@19majkel94 I see, I've read the issue and saw that you agreed (february) with guys from graphql-js, but not sure what does that mean for current situation? Is it going to be blocked, or something is happening? |
I am waiting for changes in GraphL spec and And @Hossein-s is working on a workaround to modify |
@19majkel94 is it the extend keyword in #228 though? Doesn't #228 do the whole, |
@j I know, in #228 I was thinking about both merging typedefs from different file and Edit: |
@19majkel94 bummer, yeah looks like most "code first" node.js implementations are going to have a rough time from what I was reading. I saw a post of someone requesting a different way of making schemas to make it easier, but I'm not sure what it'd take. Apollo Federation is the next step for our company's infrastructure and will have to move away from type-graphql if support doesn't come to, and that'll be a sad day. :( |
graphql-nexus/nexus#148 for reference |
Maybe I could just drop building schema using |
@19majkel94 that sounds pretty flexible? Also, again, I haven't dug into how to do it within your library. Are you looking at the SDL Examples: You wouldn't need to do anything that the gateway does, just be able to output what the sibling does per spec. But just outputting string schema's seems like the most flexible? |
Another issue to help solve code first libraries: https://github.com/apollographql/apollo-server/issues/2769 |
Another note I saw regarding "extends". https://www.apollographql.com/docs/apollo-server/federation/federation-spec/ The spec actually supports this: type User @key(fields: "id") @extends {
id: ID! @external
reviews: [Review]
} But still looks like a lot of work, :( |
I've added an example of apollo-federation (a modified federation demo from @j PR): I will leave this PR open to collect some feedback about the integration. |
Hi guys! Thanks for this amazing library! |
@lgabeskiria Have you tried the latest beta release? Without testing and confirmation I won't release "stable" package. |
No updates. It can be enabled once the federation support in this repository is no longer beta. Currently it would require EDIT: + updating the package.json of course |
@tuxmachine well, if we consider beta anything with version minor to 1.0.0, then TypeORM is also a beta... and as we know, is one of the best ORM for typescript, and the default ORM for |
@gperdomor No, I consider it beta because it's listed under "unreleased" in the changelogs of Edit: to clear up confusion, type-graphql itself is not beta. The directives feature is. |
ohh I see... In that case I think we should wait... |
I've been playing around with the typegrahpql federation example and I don't know how to get the auth checker to validate the |
@MichalLytek I have been looking into using the federation example now with rc1, I think the createResolversMap util method needs to be exposed externally in order to use it outside this repo? https://github.com/MichalLytek/type-graphql/blob/master/examples/apollo-federation/helpers/buildFederatedSchema.ts#L10 |
Hello,
I ran into a problem when trying to build the federation schema using Example: Schema:
TestEnum resolver:
Error on example: GraphQLError: Enum "TestEnum" cannot represent value: "A" Possible solution: Change
|
@andrei-bitca-dc This is the behavior of the official GraphQL implementation, so you should use internal values as default values: |
@MichalLytek The problem is that it throws me this error:
|
@andrei-bitca-dc Can you reproduce that with the normal |
@MichalLytek |
So please try to reproduce the case with raw |
GraphQL-Tools's schema stitching now supports type merging similar to Federation, as well as specification of merge instructions for the gateway via directives (see our docs and https://github.com/gmac/schema-stitching-handbook for examples). We want to support specification of merge instructions via extensions for code first schemas such as TypeGraphQL Just checking first if TypeGraphQL lets you specify extensions for types and fields, and want to inquire as to whether there is anything I should know about how you handle extensions within the framework. I imagine that we will follow supposed best practices and nest our type field extensions under a GRAPHQL_TOOLS_SCHEMA_STITCHING key... We will probably have options on the gateway to modify the location of the extensions as desired. Just inquiring whether there is any TypeGraphQL specific info about extensions that I should be aware of... |
Looks pretty straightforward, thanks! |
Decided to go a different way and follow Gatsby/graphql-compose convention of reading directives from This is now released as canary, see ardatan/graphql-tools#2391 To get this working:
For a peek at fully worked out examples of stitching with SDL-first approaches, take a look at https://github.com/gmac/schema-stitching-handbook, where @gmac takes you through step-by-step from the basics all the way to hot reloading/versioning releases. Hopefully, soon an example will appear with code-first approach. Thanks! |
TypeGraphQL support is live with stitching directives: note that although TypeGraphQL supports tagging schema entities (types, fields) with directive nodes (directive use on schema entities) via extensions, it does not seem to support adding actual directive entities (the actual definitions of custom directives). I think this is incorrect behavior, a server might want to implement a custom directive on a query. You can do this quite easily in
I worked around this by using |
Woops, fantastic! |
Example updated. We don't need skipCheck true even! |
So one cannnot use type graphql with apollo federation? Is it impossible or just tricky? Or why is this still open? |
Hi, is there any update on the |
I got it to work by declaring it as a
Then when building the federated schema, i just add this to the
I guess this is the only workaround until |
this works for me too! thanks How hard is it to create syntactic sugar for this via @ObjectType directive, and make it receive __resolveReference function? |
Is your feature request related to a problem? Please describe.
I guess it would be about to add some decorators for @key, @extend etc, to be able to declare federation schema services.
Describe the solution you'd like
https://blog.apollographql.com/apollo-federation-f260cf525d21
The text was updated successfully, but these errors were encountered: