let `require-id-when-available` validate when fragment is present
See original GitHub issueconsider
fragment a on A {
id
aField
}
# import "./a.fragment.graphql"
query AQuery {
as { ...a }
}
Field “id” must be selected when it’s available on a type. Please make sure to include it in your selection set!eslint@graphql-eslint/require-id-when-available
require-id-when-available
should allow fields which contain (only?) fragment spreads. Bonus points if the fragment themselves validate as having id
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (6 by maintainers)
Top Results From Across the Web
let `require-id-when-available` validate when fragment is ...
Error: You have used a rule which requires GraphQL operations to be loaded. Found "parserServices" generated, but unable to load your GraphQL operations....
Read more >Fragments - Apollo GraphQL Docs
A GraphQL fragment is a piece of logic that can be shared between multiple ... declare firstName and lastName fields for the NameParts...
Read more >Android Fragment no view found for ID? - Stack Overflow
Yes, check that you replace a fragment in the current container. Use right id of the container (I used another screen's id and...
Read more >Fragment | Android Developers
javax.xml.validation ... FragmentLayout$TitlesFragment" android:id="@+id/titles" ... Called to ask the fragment to save its current dynamic state, ...
Read more >ViewPager with FragmentPagerAdapter - CodePath Cliffnotes
ViewPager android:id="@+id/vpPager" android:layout_width="match_parent" ... Next, let's suppose we have defined two fragments FirstFragment and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Added another round of fixes in https://github.com/dotansimha/graphql-eslint/commit/08007cbf53731b29fba1cf3c01cb7db7eec7222c , now it should work better with inline fragments. Available in
@graphql-eslint/eslint-plugin@0.5.0
. Let me know if there are other issues.@tvvignesh this issue is currently blocked because I didn’t have the time to implementing the siblings operations support. Since ESLint runs only on a single file every time, we can’t really know that’s in that fragment, so we don’t know if there is
id
field there. I started a PR with parser performance improvements required for this, hope to have progress on that next week 😃 This feature should allow us to do so much more with graphql-eslint 😃