Comments (10)
At the moment, the PersistedQueryNetworkInterface
subclasses the HTTPFetchNetworkInterface
although it doesn't really have to do this. Would appreciate a PR that has it depend on a generic NetworkInterface instead!
from persistgraphql.
@Poincare I'd like to take a stab at this, is there a contribution guide I can follow?
from persistgraphql.
@ramikhalaf Awesome! There isn't really a contribution guide but, here's basically the equivalent of one for this particular issue:
This is where the network interface is currently implemented. What you probably want to do is replace this class with a method like addPersistedQueries
that takes an Apollo Client Network Interface and changes it so that the query IDs are sent instead. Something like this, except that instead of adding two new methods, you want to replace one of the methods within the Apollo Client Network Interface.
Please let me know if the above makes sense - I can answer questions along the way :)
from persistgraphql.
@Poincare checkout #9 and let me know if theres anything I can make better!
from persistgraphql.
I see #9 was merged. Any chance of releasing this soon, so I can test it out.
from persistgraphql.
Great work. I opened a PR against apollo-client for the last necessary step (passing through the 'id' property on the request object when batching).
apollographql/apollo-client#1302
from persistgraphql.
@mitjade Will be released tomorrow night - may be coupled with a couple of other small changes.
@fubhy Thanks! Getting batching working with persisted queries would be super cool.
from persistgraphql.
I seen this was now released and am trying to get this to work.
How would one change for example:
const client = createApolloClient(createBatchingNetworkInterface({
uri: apiUrl,
opts: {
credentials: "same-origin",
headers: req.headers,
},
batchInterval: 20,
}));
to work with PersistedQueryNetworkInterface
?
However I try to wrap or replace it with PersistedQueryNetworkInterface
, I keep getting TypeError: Cannot set property '_uri' of undefined
.
I have latest apollo-client
0.8.7 and persistgraphql
0.3.0 packages.
from persistgraphql.
Sorry, missed addPersistedQueries(networkInterface: NetworkInterface, queryMap: OutputMap)
that is mentioned in readme.
from persistgraphql.
Was able to test this and it is working. Will close this now.
from persistgraphql.
Related Issues (20)
- Maximum call stack error when using cloneDeep in query transformer
- [Idea] replace json property names with ordinals to reduce bandwidth HOT 4
- Must provide a query error when use with graphql-subscription
- Mixing .graphql files with tagged template literals HOT 1
- Server and client sync
- Can it be used with Relay Modern? HOT 2
- can't install on Windows HOT 2
- [BUG] persistgraphql serializes *differently* from apollo client, breaking the whitelist HOT 1
- Register query manually
- Support glob syntax [feature request]
- [BUG] template strings within attributes not parsed correctly
- How should we namespace open source queryTransformers? HOT 7
- Hapi17 Example
- Relax dependency requirements HOT 5
- Does not recognize .gql file extension HOT 1
- Commented out query causes syntax error during javascript extraction
- Queries from both external graphql files and JS extraction aren't output together
- This tool can only generate 1 query when scan a directory that contains multiple ".graphql" files HOT 2
- Add / enable Travis CI
- Support babel compiled AST.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from persistgraphql.