Skip to content

Adding a versioned GraphQL schema as a Hasura remote schema. #579

@KallivdH

Description

@KallivdH

Module version(s) affected

5.1.3

Description

I am currently testing on a project in Hasura and thought it would be interesting to add a SilverStripe GraphQL scheme. Unfortunately, I get an error when I do this:

The type of Object field 'SiteTree'."versions" (ModelPageVersionConnection) is not the same type/sub type of Interface field 'SiteTreeInterface'."versions" (SiteTreeVersionConnection)

I did manage to add the schema when versioning is disabled. Does anyone have any idea what it could be due to. Unfortunately, I am not getting any wiser from the generated schema....

How to reproduce

  • Run a Hasura instance on your pc via Docker.
  • Run a SilverStripe instance on your pc.
  • Make sure that the GraphQL endpoint is reachable.
  • Make sure versioning is enabled/installed for models in the schema.
  • Add the SilverStripe GraphQL endpoint as a remote schema in hasura.

Possible Solution

Let ModelPageVersionConnection implement the SiteTreeVersionConnection interface

Additional Context

No response

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions