Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@subql/apollo-links

Package Overview
Dependencies
Maintainers
2
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@subql/apollo-links - npm Package Compare versions

Comparing version 0.2.1-9 to 0.2.1-10

4

package.json
{
"name": "@subql/apollo-links",
"version": "0.2.1-9",
"version": "0.2.1-10",
"description": "SubQuery Network - graphql links",

@@ -26,3 +26,3 @@ "main": "dist/index.js",

},
"stableVersion": "0.2.1-8"
"stableVersion": "0.2.1-9"
}

@@ -1,5 +0,44 @@

# Apollo Links for SubQuery Network
# @subql/apollo-links
## Usage
## Description
- This package contains an extended version of apollo-link and various utilities to perform authentication with our network services.
- This package is use to authenticate with the subquery network's auth center.
## Usage
For example of usage see our [test cases](../../test/authLink.test.ts)
```TS
import { ApolloClient, from, HttpLink, InMemoryCache } from '@apollo/client/core';
import { authHttpLink } from '@subql/apollo-links';
import fetch from 'cross-fetch'; // doesn't need to be this fetch library
const options = {
authUrl: `http://example-url.com/token`,
sk: '<insert secret key here>',
indexer: '<insert indexer address here>',
consumer: '<insert consumer address here>',
chainId: 1287,
deploymentId: '<insert deployment id here>',
agreement: '<insert agreement id here>',
};
const link = await authHttpLink(options);
const client = new ApolloClient({
cache: new InMemoryCache({ resultCaching: true }),
link: from([authLink, new HttpLink({ uri, fetch })]),
});
const metadataQuery = gql`
query Metadata {
_metadata {
indexerHealthy
indexerNodeVersion
}
}
`
await client.query({ query: metadataQuery });
```

@@ -6,0 +45,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc