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

GraphQL tool for easily connecting to remote graphql services

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

graphql-connect

GraphQL tool that makes for easy remote schema connections and merging multiple schemas into one.

alt text

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! :)

Keywords

FAQs

Package last updated on 25 Feb 2018

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

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