AniTrend / retrofit-graphql

Retrofit converter which uses annotations to inject .graphql query or mutation files into a request body, along with any variables.
https://anitrend.github.io/retrofit-graphql/
Apache License 2.0
109 stars 19 forks source link

Fragment not working for mutation. #17

Closed Brajendra closed 5 years ago

Brajendra commented 5 years ago

Fragment not working for mutation most of the time.

wax911 commented 5 years ago

Hi, in future please use the issue templates provided e.g. Bug Issue Template. Also look at issues that are marked with good first issue such as:

issue: #9

Please describe what the issue is in detail, including but not limited to:

Also any additional contextual information would be helpful such as logs, or anything to back the issue.

Thanks!

Brajendra commented 5 years ago

com.github.AniTrend:retrofit-graphql:1.0.0-alpha01 Folder Structure

assets/graphql/Fragment/CommentFragment.graphql assets/graphql/Mutation/delete_comment.graphql assets/graphql/Query/fetch_comment.graphql

mutation deleteComment($id: Int!) { deleteComment(id: $id, body){ ...CommentFragment } }

fragment CommentFragment on Comment{ id body editorRawData deletedAt }

For query, It is working fine for me but only for mutation, it is failing. For Mutation only work if I define Fragment in the same file.

{"errors":[{"message":"Unknown fragment \"CommentFragment\".","locations":[{"line":1,"column":168}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}}]}

eschlenz commented 5 years ago

@wax911 This is probably a simple fix that can be made to the Fragment support I added. If you don't mind me doing so, I'll get a PR up for this.

wax911 commented 5 years ago

That would be awesome! please go right on ahead with your PR :fire:

eschlenz commented 5 years ago

PR opened! :) https://github.com/AniTrend/retrofit-graphql/pull/19

eschlenz commented 5 years ago

@Brajendra It looks like this got merged into master by @wax911. I'm not sure when the next release will go out that has it, but you could at least build this project locally until then.

wax911 commented 5 years ago

I'll just need to update the documentation and I'll release it under v0.10.1 :+1: in a couple of hours

Sorry about the confusion I don't know why I created v1.X.X seeing how the recent changes were only incremental features and fixes

wax911 commented 5 years ago

@Brajendra v0.10.1 is should be available for download :ok_hand:

eschlenz commented 5 years ago

Thanks @wax911!

Brajendra commented 5 years ago

Thank you so much.

On Fri, Jun 21, 2019 at 6:35 AM Eric Schlenz notifications@github.com wrote:

Thanks @wax911 https://github.com/wax911!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AniTrend/retrofit-graphql/issues/17?email_source=notifications&email_token=AAOBRAJ63UJTPLSFBBZ7AVLP3QSOJA5CNFSM4HYGDRUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYHEG4A#issuecomment-504251248, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOBRAI43EOIYQ77H44HPQTP3QSOJANCNFSM4HYGDRUA .

-- Thanks & Regards Brajendra Pandey Mobile +91-9650307763 Skypee brajendra.pandey2

wax911 commented 5 years ago

Welcome :heart: we should be thank you @eschlenz :100: