Skip to content

Add urql integration package#671

Open
jeffkreeftmeijer wants to merge 1 commit intomainfrom
add-urql-integration
Open

Add urql integration package#671
jeffkreeftmeijer wants to merge 1 commit intomainfrom
add-urql-integration

Conversation

@jeffkreeftmeijer
Copy link
Copy Markdown
Contributor

Based on the example implementation in https://github.com/appsignal/test-setups/tree/reproduce-graphql-error-react, this patch adds a new @appsignal/urql package that provides automatic GraphQL error reporting for applications using the urql GraphQL client.

The package exports a createAppsignalExchange function that creates a custom urql exchange to intercept all query and mutation results and automatically report errors to AppSignal without requiring changes to individual useQuery calls.

This provides a seamless integration for urql users to get complete visibility into GraphQL errors in their applications.

Usage

import { createClient, fetchExchange } from 'urql';
import Appsignal from '@appsignal/javascript';
import { createAppsignalExchange } from '@appsignal/urql';

const appsignal = new Appsignal({
  key: 'YOUR FRONTEND API KEY'
});

const client = createClient({
  url: 'https://api.example.com/graphql',
  exchanges: [createAppsignalExchange(appsignal), fetchExchange]
});

Testing

Use the https://github.com/appsignal/test-setups/tree/reproduce-graphql-error-react branch, and hook that up to a local checkout of the repository. I haven't been able to get the test-setup to fetch from GitHub directly.

@jeffkreeftmeijer jeffkreeftmeijer self-assigned this Mar 26, 2026
@jeffkreeftmeijer jeffkreeftmeijer added the feature A new feature for this component. label Mar 26, 2026
@backlog-helper
Copy link
Copy Markdown

Hi @jeffkreeftmeijer,

We've found some issues with your Pull Request.

  • This Pull Request does not include a changeset. Add a changeset if the change impacts users and should be included in the changelog upon release. Read more about changesets.
    Ignore this rule by adding [skip changeset] to your Pull Request body. - (More info)

New issue guide | Backlog management | Rules | Feedback

Add a new @appsignal/urql package that provides automatic GraphQL
error reporting for applications using the urql GraphQL client.

The package exports a createAppsignalExchange function that creates a
custom urql exchange to intercept all query and mutation results and
automatically report errors to AppSignal without requiring changes to
individual useQuery calls.

Error reports include:
- GraphQL query body as a parameter
- Endpoint URL as a tag
- Operation name and type as tags when available

This provides a seamless integration for urql users to get complete
visibility into GraphQL errors in their applications.
@backlog-helper

This comment has been minimized.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add tests for this as well.

@backlog-helper

This comment has been minimized.

3 similar comments
@backlog-helper

This comment has been minimized.

@backlog-helper

This comment has been minimized.

@backlog-helper
Copy link
Copy Markdown

backlog-helper bot commented Apr 3, 2026


This is a message from the daily scheduled checks.

New issue guide | Backlog management | Rules | Feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A new feature for this component.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants