Open ericlewis opened 4 years ago
Hi! There's definitely some significant obstacles to this at the moment, particularly around how things are ingested for code generation. Right now, we only ingest from .graphql
files rather than from any arbitrary file, and without having to worry about what is a Swift String
that contains a GraphQL query or anything like that.
This is definitely an enhancement to consider for the long term, but I'll be honest, we've got way bigger problems to solve first.
don't see this happening to be fair, more likely would be some kind of DSL
Thats' an interesting idea - I think the main issues I see with it are a) How would we ensure that queries are valid? and b) How would we generate the classes necessary for parsing the result?
Definitely going to think on that when I get back to this issue though.
Hi 👋🏻 - we've taken this into consideration and decided to defer it to a future 1.x release. We're not rejecting nor closing this issue but it's not on the roadmap yet. If this issue is important to you please let us know in this issue and it will help with prioritization - thank you!
We've been discussing dynamic operations lately, i.e.: don't need an input file, and this would fit in line with that work.
This might be old hat and I know it’s not a great issue but need to write down somewhere:
You should be able to describe fragments or query’s with inline strings as opposed to colocating with graphql files.
It probs seems minor but from a DX perspective the whole co-locating things a big deal.
Creating more folder structure to organize is less good than just having the query in a used component. This is probably more true of SwiftUI than anything, and I have some SwiftUI stuff to contribute if folks want it.