[SOLVED] Possible wrong data type in graphql schema

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [x] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

I have created a schema (single content) “Homepage” and another one “header-call-to-action-description-image” (component). The “homepage” schema contains a component field “Header” (localizable) I added the component.
The GraphQL query loks like this:
{ queryHomepageContents { data { title {iv} content {iv} header { de { callToActionLabel callToActionUrl description image { url } } } } } }
It works in the embedded GraphiQL client. But property “de” is defined as a scalar in the schema. This isn’t correct, right? The Client in my .NET Project produces the error message: “SS0002 de returns a scalar value. Selections on scalars or enums are never allowed, because they are the leaf nodes of any GraphQL query.”

I’ve tried to add the component non- localizable but the resulting iv has the same problem.

Expected behavior

Minimal reproduction of the problem

Environment

  • [ ] Self hosted with docker
  • [x ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: 6.4.0

Browser:

  • [ ] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [x ] Edge

Others:

I have never had complaints about that before. Which client do you use?

Edit: I think the error message is not about the “en” field, but about the content or header field, but I don’t know why it things that this is scalar. Can you upload your schema/introspection somewhere? Check the network calls in the browser for that. The file could be relatively big.

Thank you for your quick reply. The client is called StrawberryShake. You can find the schema.graphql file here: schema.graphql - Google Drive

Even the GrapiQL indicates a syntax error but as I mentioned before no runtime error is thrown – the query works as expected.

In Squidex you can basically attach any value to a component.

Right now it works like this:

  • If you have defined that a component can be of one type only, a type safe field type is generated.
  • If a component can be one of multiple schemas a JSON scalar is generated.
  1. I have added another allowed schema to the component “header” field. The ‘de’ is still a scalar value.
  2. I have added a field called “sections” of type components with 2 allowed schemas with the same result.

schema2.graphql - Google Drive

AFAIK it only works when you have only one schema for a component. But I am not so sure about 6.4

Here is the logic ( I was wrong before)

  1. One component: Simple type.
  2. Two or more components: Union Type

I am not sure why it does not work in your case. I have to debug it I guess.

My test just works:

I need to investigate further, something is weird

I’ve tried your smallest possible sample on my version 6.4. with the same result like before. I could try another version of squidex if it’s helps.

I think there is some kind of race condition, because sometime it works for me locally.

It is a bug and I have fixed it. Unfortunately I cannot push to git right now.

Im glad to hear it. Thank you very much. Please drop me a line when the fix is available.

This topic was automatically closed after 2 days. New replies are no longer allowed.