-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add remote hosted endpoint support #2915
Add remote hosted endpoint support #2915
Conversation
(mainly directly copied from enterprise gateway)
packages/apollo-gateway/src/__tests__/integration/networkRequests.test.ts
Outdated
Show resolved
Hide resolved
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.
@JacksonKearl this is a great start! Super exciting to see this come together! Can you sync with @trevor-scheer on his current work on observability and control points that may impact this? SO excited to get this in!
packages/apollo-gateway/src/__tests__/integration/networkRequests.test.ts
Outdated
Show resolved
Hide resolved
mockGetCompositionConfigLink(); | ||
mockGetCompositionConfigs(); | ||
mockGetImplementingServices(); | ||
mockGetRawPartialSchema(); |
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.
Since these are async in the actual code, I think we should make these match the call ordering and make them async here as well
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.
Bit confused. The installation of the mock is synchronous.
packages/apollo-gateway/src/__tests__/integration/networkRequests.test.ts
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,114 @@ | |||
import nock from 'nock'; | |||
|
|||
export const mockLocalhostSDLQuery = () => |
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 think we should provide a way to override the results of these requests so we can test error handling better
export interface HostedGatewayConfig extends GatewayConfigBase { | ||
apiKey?: string; | ||
tag?: string; | ||
federationVersion?: number; |
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.
@JacksonKearl I know that @trevor-scheer has been thinking through fallbacks and control overrides for fetching from the managed system in case of failure. I wonder if we should merge all three of these configs together into a simpler apiKey + serviceList / way to fetch services?
Can you sync with him on those ideas?
This enables config after construction.
cf5abb1
to
3e769f1
Compare
I have no clue how to revert the merge. |
Nvm |
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.
Mostly commentary, but overall looks pretty good!
packages/apollo-gateway/src/__tests__/integration/networkRequests.test.ts
Outdated
Show resolved
Hide resolved
packages/apollo-gateway/src/__tests__/integration/networkRequests.test.ts
Outdated
Show resolved
Hide resolved
Co-Authored-By: Jesse Rosenberger <git@jro.cc>
Merging into staging now because can't really build anything on top of these while all the components are implemented on independent branches. |
…teHostedServiceLists
(mainly directly copied from enterprise gateway)
Feedback on best testing mechanism appreciated. There are a bunch of GCS calls made for the various links, so my approach was to install a
nock.recoder
, get a trace of all of the requests, and install the mocks in various tests, in each test asserting that each of the relevant mocks was appropriately called.