🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@embrace-io/apollo-graphql

Package Overview
Dependencies
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@embrace-io/apollo-graphql

This is used to track networks calls using GraphQL with the Embrace SDK

unpublished
latest
Source
npmnpm
Version
3.17.0
Version published
Maintainers
4
Created
Source

React Native Embrace - Apollo GraphQL

Core Module Required

This module requires React Native Embrace SDK.

Add React Native Apollo Tracker

Adding Context to Sessions

Embrace can collect basic session data and crashes as you've already seen in the Crash Reporting and Session Reporting sections. Embrace can also collect the screens that your app opened and include it as context within your sessions. Here's how you add the screen tracker to the session.

Adding the component

Embrace has a separate module for tracking Apollo network, to use it you will need to add the Apollo Tracker

Install the component

yarn add @embrace-io/apollo-graphql

npm install @embrace-io/apollo-graphql

Adding the component to your code

Apply the Apollo GraphQL tracker to your Apollo provider instance.

import EmbraceApolloLink from "@embrace-io/apollo-graphql";
import {
  ApolloClient,
  InMemoryCache,
  ApolloProvider,
  ApolloLink,
  createHttpLink,
  useMutation,
  gql,
  useQuery,
} from "@apollo/client";

const App = () => {
  return <MyApp />;
};
const ApolloWrapper = () => {
  // Start - Add this line
  const embraceCreateHttpLink = new EmbraceApolloLink.build(
    ApolloLink,
    createHttpLink
  );
  // End - Add this line
  const client = new ApolloClient({
    // Use the Embrace create Http Link
    link: embraceCreateHttpLink({
      uri: "https://api.mocki.io/v2/c4d7a195/graphql",
      headers: { "x-emb-path": "/graphql/v1beta/steve" },
    }),

    cache: new InMemoryCache(),
  });
  return (
    <ApolloProvider client={client}>
      <App />
    </ApolloProvider>
  );
};

{{< hint info >}}

The build method has a third parameter that is platform, you can pass ios or android, if you only want to track in one of them

{{< /hint >}}

FAQs

Package last updated on 16 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts