-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
[FEATURE] Add inline fragments support #55
Comments
Hey Andriy, thanks for submitting the issue. The closed issue you saw was a feature that I intended to implement originally but then I dropped it in favor of more important ones and ended up never picking that up again. But I think it's time to review those since, as of today, GotQL does not implement fragment support. This will be a pretty big change in the codebase, so it might take a while, but I think it makes sense to amplify the extension of the query language. |
Hi @khaosdoctor Could you provide some approximate date when we can expect new release version? We understand that it is open source tool and it might take time to prepare all thinks but we need to know approximate date to understand what we should do next( change the library or wait for release). Thanks a lot that you are active owner of the current project!! |
Since I'm working single-handed on this project, it might take about a month or so if I'm able to work without any hassle. I think I can come up with something in two or three days of work, but I'll need to study the fragments and see how I can integrate those into the quer language spec. If you have any ideas and/or suggestions on how this would work for you, I'd be glad to hear :) |
Hi @khaosdoctor! |
Hey @andriy-sermiahin I'm still working on it, I had a few health issues and I'm treating them first, but I'll try to release an alpha version of it by the end of the month. This release will not count towards the latest releases but it'll be a start for you to begin using it |
Ok people, sorry about the delay, I had some health issues and I was away for the month, still recovering, but I'll give it a go soon, I haven't forgotten about this. |
It's alright @khaosdoctor please take your time and recover. anytime you are ready to work, you can get back. this work is always going to be here. Thank you for all the hardwork put into this project @khaosdoctor |
Alright folks I'm back o/ thanks a lot for your consideration and patience. I'll work on this next week and try to get an alpha version out. I don't know if it's going to be what you are expecting because it requires some major changes to be officially "good". What I'm planning is to launch a v0 where you can define your fragments using string notation so I don't have to rewrite the entire parser. V1 will be better integrated into the query language. Does it sound nice? |
As requested by #55 this address a first approach to add the fragment support
Hey! Just added the first fragment usage part. If you want to test it be sure to download The added resources were:
const query = {
operation: {
fields: [ 'f1' ]
},
fragments: [
`fragment Test on Character { name id }`
]
}
const query = {
operation: {
fields: [ fragment`Test` ]
},
fragments: [
`fragment Test on Character { name id }`
]
} For now, the query will not test for non existing fragments and it'll not test for invalid uses. I should rewrite this module as a part of the query framework and the object framework when I free up some time to work on it. I also need to refactor some code because it's getting complicated to fiddle with it. |
For hacktoberfestThis needs a good refactor, it's in the alpha version, support is limited, and it's a template string, it needs to be converted to a fully fledged JSON-like structure like the rest of the queries |
I have seen that there is a closed issue regarding adding graphql fragments support for v1.7.0 but I haven't found it in release notes or source code.
Could you implement such a feature for gotql or give an example of how to use it if I am wrong and gotql v2.* supports fragments?
We are using gotql for more than 6 months and it's already deeply implemented in our code to change it to something else.
The text was updated successfully, but these errors were encountered: