How i can resolve conflict type AcfLink

272 Views Asked by At

I have a problem with Gatsby, I have a type conflict in Link relation in WordPress

Fields "button" conflict because they return conflicting types AcfLink and String. Use different aliases on the fields to fetch both if this was intentional.

 Error path: undefined

in query request

button {
      url
      title
    }

How do I resolve this conflict

1

There are 1 best solutions below

0
On

You can alias both fields with:

button {
      newName1: url
      newName2: title
    }

After that, you will need to refer to each field using button.newName1 and button.newName2 respectively.

GraphQL aliases docs: https://graphql.org/learn/queries/#aliases