New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

graphql-connect

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-connect - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"name": "graphql-connect",
"version": "1.0.3",
"version": "1.0.4",
"description": "GraphQL tool for easily connecting to remote graphql services",

@@ -5,0 +5,0 @@ "main": "index.js",

# graphql-connect
GraphQL tool that makes for easy remote schema connections
GraphQL tool that makes for easy remote schema connections and merging multiple schemas into one.
### Get Started
- Install `npm install graphql-connect`
- Import `const { createRemoteSchema, mergeSchemas } = require('graphql-connect');`
#### Connect Remote Schema
```
const remoteSchema = createRemoteSchema({
uri: 'localhost:8080/graphql'
});
```
#### Merge Multiple Schemas Into One
```
const schemas = await mergeSchemas({ schemas: [remoteSchema] });
```
#### Example
```
import { createRemoteSchema, mergeSchemas } from 'graphql-connect';
// Local Schemas
import cmsSchema from './schemas/cms';
export default async userToken => {
// Remote Schemas
const userSchema = createRemoteSchema({
uri: process.env.user,
headers: {
'X-Auth': userToken,
Authorization: process.env.user_secret
}
});
// Return both schemas merged into one
return await mergeSchemas({ schemas: [userSchema, cmsSchema] });
};
```
#### Contributions
Contributions, issues, and feature requests would be awesome, just submit an issue or PR! :)
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