Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Error: Found unsupported source node type "Unknown" in reduceObjectStructures call. #326

Open
michelebruno opened this issue Sep 12, 2023 · 1 comment

Comments

@michelebruno
Copy link

Hi,

I've found a little issue with the query type definition. With the following query I get the error Failed to parse query GetPageById. Error: Found unsupported source node type "Unknown" in reduceObjectStructures call. Please open an issue. and the query is not added to the types file.

export const getPageByIdQuery = codegen('GetPageById', groq`*[_type == 'page' && _id == $id][0] {
  ..., 
  content[] {
    ...,
    _type == "projectList" => {
      ...,
      projects[]-> {
        ...
      }
    }
  },
}`)

I tried some bug fixing, it looks like that the error only occurs when I try to expand an array of references projects[]-> { ... }.

It would work in these cases projects -> { ... }, projects[]-> or projects[] { ... }

@michelebruno
Copy link
Author

michelebruno commented Sep 12, 2023

Update, it's more related to the .... operator. Is there a way to state the object type in the groq query?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant