Skip to content

Inconsistencies whereby some instances of the field do not allow subsets and returns a string only | GraphQL + linkfield 2.0.0-rc.1 #168

Open
@toddpadwick

Description

@toddpadwick

I have a strange issue, that despite clearing cache, re-installing and re-creating fields, some instances of the linkfield do not allow any subsets whereas others do.
For example:

This works (supertable field inside a matrix)

    cta {
        ... on cta_BlockType {
          linkTo {
            url
            element {
              slug
              uri
              id
              title
            }
            text
          }
          weight
        }
      }
    }

returns successfully:

        "cta": [
            {
              "linkTo": {
                "url": "https://cms.protopixel.io/showcase",
                "element": {
                  "slug": "showcase",
                  "uri": "showcase",
                  "id": "1024",
                  "title": "Showcase"
                },
                "text": "Find out how"
              },
              "weight": "tertiary"
            }
          ]

This doesn't work (supertable field inside a global)

    ... on footer_GlobalSet {
      utilityNav {
        ... on utilityNav_group_BlockType {
          label
          links {
            ... on links_BlockType {
              linkTo {
                url
                text
              }
            }
          }
        }
      }
    }

returns error:

    {
      "errors": [
        {
          "message": "Field \"linkTo\" of type \"String\" must not have a sub selection.",
          "extensions": {
            "category": "graphql"
          },
          "locations": [
            {
              "line": 10,
              "column": 22
            }
          ]
        }
      ]
    }

I have tried the following:

  • Turning the field into a string field, saving, then clearing cache, then re-saving as a link field again
  • deleting vendor and re-installing
  • re-building yaml files
  • re-generating all yaml updates

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions