Comments (10)
Yeah, definitely! In fact, that would help solve #17 as well since people could just build stuff on top of the ExtractGQL
class or similar. Would be happy to accept PRs on this and also get involved in the implementation.
from persistgraphql.
awesome, this is something that im happy to take a look at in the next week or so.
where should this go? should an apollographql/extract-gql repo be created for this? or should i just create a repo to do this and transfer it over later?
from persistgraphql.
@lewisf I think the best option is for you to create a prototype on a personal repo, then we can move it into the organization afterwards?
We should also see if this can replace https://github.com/apollographql/graphql-document-collector, which is pretty old and I'm not sure many people use it. The intention was to do something similar.
from persistgraphql.
Okay, sounds reasonable, I'll give it a shot
from persistgraphql.
Quick update after speaking with @Poincare. It looks like the ExtractGQL class is exactly what should get extracted.
After extracting it we'd be able to use it to solve #17 as mentioned above, and I'd be able to use it to address apollographql/apollo-tooling#25.
I'm going to work on this and seeing if anything needs to change (public/private methods) etc. We can leave this issue open until that package exists and is integrated back into persistgraphql.
from persistgraphql.
Okay, I've done some initial work in extracting ExtractGQL here:
https://github.com/lewisf/extract-gql
I've even tried using it in another project locally and it worked well (yay). I haven't done an audit of the public interface but it's good to know that the extraction was pretty straightforward due to how ExtractGQL was written here.
Some key improvements I want to make to extract-gql before publishing it as a package are going to be documented there. Namely:
Please let me know if there are any other issues that should be addressed before extract-gql should go live.
I've also opened up other issues on it based on me trying to use it with an existing project we have here at Coursera, but I don't think those are blocking the re-integration of extract-gql back into persistgraphql.
from persistgraphql.
@lewisf Great! Most of those issues and general direction look good to me.
However, I did think that the package you would be building wouldn't actually include any of the CLI portions that this tool provides. Instead, it should just focus on providing a simple library that allows other projects (e.g. apollo-codegen
) to build on top of the query extraction. Then, persistgraphql
can simply use that library internally rather than having the ExtractGQL
class as it is currently implemented and persistgraphql
would provide the CLI functionality on top. Does that sound reasonable?
from persistgraphql.
@Poincare yes that definitely does sound reasonable. I'll go ahead and make that modification to extract-gql's responsibilities
from persistgraphql.
Hey @lewisf any progress on this? Any way I can help?
from persistgraphql.
@Poincare sorry! i had to shift focuses to prioritize something else -- happy to chat about this if you wanted to take a stab at this
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.