Problem with fragments
See original GitHub issueI probably have done something wrong, but I can’t see what.
The error I’m seeing is:
find frag Likes_3K7mRP Likes
Error: Fragment doesn't exist in its own document?!
at file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:77683:55
at step (file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:124:23)
at Object.next (file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:105:53)
at file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:98:71
at new Promise (<anonymous>)
at __awaiter$1 (file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:94:12)
at file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:77627:58
at Array.map (<anonymous>)
at file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:77627:30
at step (file:///home/dexter/Projects/BENDERFACToRY/vault/node_modules/houdini/build/cmd.js:124:23)
I added the ‘find frag’ log statement to figure out what’s in there:
matchingFragment = fragments.find(function (fragment) {
console.log('find frag', fragment.name.value, name)
return fragment.name.value === name; });
if (!matchingFragment) {
throw new Error("Fragment doesn't exist in its own document?!");
}
The setup for my fragment is:
import { fragment, mutation, graphql, Likes } from '$houdini';
export let id;
export let likes: Likes;
const data = fragment(
graphql`
fragment Likes on media @arguments(userId: { type: "uuid!" }) {
likes(where: { user_id: { _eq: $userId } }) {
media_id
}
}
`,
likes
);
And the ‘parent’ is:
const { data, loading, error } = query<AllTracks>(graphql`
query AllTracks($userId: uuid!) {
media(order_by: [{ likes_aggregate: { count: desc } }, { title: asc }]) {
title
bpm
data_folder
id
recorded_date
stereo_mix
tracks
likes_aggregate {
aggregate {
count
}
}
...Likes @with(userId: $userId)
}
}
`);
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
7 Common Mistakes Easily Made with Android Fragment
Mistake makes when working in Fragment sometimes are hard to debug, as it is not always replicable due to its complicated lifecycle event....
Read more >Fragments: The Solution to All of Android's Problems
A comprehensive look at the state of Fragments in 2017; solution to (and cause of) all of Android's problems.
Read more >Debug your fragments | Android Developers
This guide covers tools that you can use to debug your fragments. ... log messages can help you troubleshoot issues with your fragments....
Read more >Advocating Against Android Fragments | Square Corner Blog
Fragments are view controllers; they hold decoupled chunks of business logic that can be tested. The fragment API provides backstack management ...
Read more >android - AndroidStudio - Error in Fragments - Stack Overflow
AndroidStudio - Error in Fragments ; xmlns:android · "http://schemas.android.com/apk/res/android" ; xmlns:tools · "http://schemas.android.com/tools" ...
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
Ah damn! I have a hunch what’s causing this, I’ll try to get something out ASAP. Thanks for reporting it
Going to close this since its gone stale. If you have a reproducible error I’d love to take a closer look