-
Notifications
You must be signed in to change notification settings - Fork 574
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
[federation] add tests + handle failure + handle logs #3328
Conversation
🦋 Changeset detectedLatest commit: 9d1b732 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Apollo Federation Subgraph Compatibility Results
Learn more: |
✅ Benchmark Results
|
🚀 Snapshot Release (
|
Package | Version | Info |
---|---|---|
@graphql-yoga/apollo-link |
3.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/urql-exchange |
3.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/redis-event-target |
3.0.1-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/graphiql |
4.3.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
graphql-yoga |
5.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/nestjs |
3.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/nestjs-federation |
3.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-apollo-inline-trace |
3.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/apollo-managed-federation |
0.1.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-apq |
3.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-csrf-prevention |
3.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-defer-stream |
3.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-disable-introspection |
2.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-graphql-sse |
3.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-jwt |
2.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-persisted-operations |
3.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-prometheus |
5.1.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-response-cache |
3.6.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-sofa |
3.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/render-graphiql |
5.4.0-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/subscription |
5.0.1-alpha-20240618085719-9d1b7321 |
npm ↗︎ unpkg ↗︎ |
💻 Website PreviewThe latest changes are available as preview in: https://45a2c7e4.graphql-yoga.pages.dev |
}; | ||
|
||
export function useManagedFederation(options: ManagedFederationPluginOptions = {}): Plugin { | ||
const supergraphManager = new SupergraphSchemaManager(options); | ||
const { | ||
logger = console, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger = console, | |
logger = console, |
You can get logger
from Yoga instance passed in onYogaInit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've used the yoga logger, but i'm still using the console by default in case the manager is logging something before yoga is initialized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can start the manager within onYogaInit maybe?🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hesitated to move it there yes...
My goal was to make it start fetching as soon as possible, but if you think it's more important to be sure the yoga logger will be used, I can make the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made the change, I think it's better to avoid losing any logs (if an external logger is provided in place of the console) than saving potentially 2ms on a 100ms call :-P
acc3720
to
a03834d
Compare
No description provided.