wpengine / faustjs

Faust.js™ - The Headless WordPress Framework
https://faustjs.org
Other
1.43k stars 131 forks source link

POC: Determine support for getting data from multiple WordPress instances via Faust Apollo client #1789

Closed blakewilson closed 6 months ago

blakewilson commented 8 months ago

Currently in Faust, there is a 1-to-1 relationship from WordPress instance to Faust site. Let's build a POC to see if we can modify the Apollo client (either by modifying the implementation or using the plugin system) to support getting data from multiple WordPress backends.

Say for instance we have two WordPress sites:

  1. WordPress Instance A
  2. WordPress instance B

And I wanted all traffic from my app to get data from WordPress instance A, except for paths under /resources, in which I want data from WordPress instance B.

We may be able to modify the Apollo Client via the plugin system to check the incoming URL, and if it matches a certain format, add or modify the HttpLink set in the client:

import { HttpLink } from '@apollo/client';

const link = new HttpLink({
  uri: "http://wp-instance-b.com/graphql
});

Acceptance Criteria

theodesp commented 7 months ago

https://github.com/habx/apollo-multi-endpoint-link

jaredcbaum commented 6 months ago

@ChrisWiegman why was this closed?

ChrisWiegman commented 6 months ago

I've closed it as it is not something the team is currently working on nor is it anticipated that we will be able t resume the work on this ticket in the future.