Cannot delete a component link from UI using UI kit

I’m building a component page to ease the link management.

On this page I added a delete button that should delete the link from the component and trigger the needed events.
For this I have a simple button

<Button appearance="danger" onClick={deleteLink}>Delete</Button>

This handler (I also tried using asApp() but has the same error)

const deleteLink = () => {
        graphqlGateway.compass.asUser().deleteLink({
            componentId: component.componentId,
            link: "link-to-be-deleted"
        }).then(r => {
            if (r.errors && r.errors.length > 0) {
                // Show warning flag
            } else {
                // Update state and show success flag
            }
        });
        closeModal();
    };

The error I get as a response from deleteLink function call is

[
    {
        "message": "The compass catalog schema has changed. Try upgrading SDK package version.",
        "errorSource": "FORGE_GRAPHQL",
        "errorType": "INTERNAL_SERVER_ERROR",
        "statusCode": 500
    }
]

But I also see these errors in the console.

Refused to connect to 'https://stargate/graphql' because it violates the following Content Security Policy directive: "connect-src 'self' ws://localhost:* http://localhost:* https://api.atlassian.com/metal/ingest my-app.eu.ngrok.io".
Refused to connect to 'https://stargate/graphql' because it violates the document's Content Security Policy.

These are my dependencies and as far as I can tell these are up-to-date:

"dependencies": {
  "@atlassian/forge-graphql": "^13.7.2",
  "@forge/api": "^3.8.0",
  "@forge/bridge": "^3.4.0",
  "@forge/react": "^10.3.0",
  "react": "^18.3.1"
}

What am I missing?

1 Like

Using a resolver to execute a function on the backend resolved this issue for me.

1 Like