How to use merge-graphql-schemas - 10 common examples

To help you get started, we’ve selected a few merge-graphql-schemas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RocketChat / Rocket.Chat / app / graphql / server / resolvers / accounts / index.js View on Github external
import { createJSAccountsGraphQL } from '@accounts/graphql-api';
import { mergeTypes, mergeResolvers } from 'merge-graphql-schemas';


// queries
import * as oauthProviders from './oauthProviders';
// types
import * as OauthProviderType from './OauthProvider-type';
import { AccountsServer } from '../../../../accounts';

const accountsGraphQL = createJSAccountsGraphQL(AccountsServer);

export const schema = mergeTypes([
	accountsGraphQL.schema,
	oauthProviders.schema,
	OauthProviderType.schema,
]);

export const resolvers = mergeResolvers([
	accountsGraphQL.extendWithResolvers({}),
	oauthProviders.resolver,
]);
github RocketChat / Rocket.Chat / packages / rocketchat-graphql / server / resolvers / channels / index.js View on Github external
import * as channels from './channels';
import * as channelByName from './channelByName';
import * as directChannel from './directChannel';
import * as channelsByUser from './channelsByUser';
// mutations
import * as createChannel from './createChannel';
import * as leaveChannel from './leaveChannel';
import * as hideChannel from './hideChannel';
// types
import * as ChannelType from './Channel-type';
import * as ChannelSort from './ChannelSort-enum';
import * as ChannelFilter from './ChannelFilter-input';
import * as Privacy from './Privacy-enum';
import * as ChannelNameAndDirect from './ChannelNameAndDirect-input';

export const schema = mergeTypes([
	// queries
	channels.schema,
	channelByName.schema,
	directChannel.schema,
	channelsByUser.schema,
	// mutations
	createChannel.schema,
	leaveChannel.schema,
	hideChannel.schema,
	// types
	ChannelType.schema,
	ChannelSort.schema,
	ChannelFilter.schema,
	Privacy.schema,
	ChannelNameAndDirect.schema,
]);
github RocketChat / Rocket.Chat / packages / rocketchat-graphql / server / resolvers / users / index.js View on Github external
import { mergeTypes, mergeResolvers } from 'merge-graphql-schemas';

// mutations
import * as setStatus from './setStatus';
// types
import * as UserType from './User-type';
import * as UserStatus from './UserStatus-enum';

export const schema = mergeTypes([
	// mutations
	setStatus.schema,
	// types
	UserType.schema,
	UserStatus.schema,
]);

export const resolvers = mergeResolvers([
	// mutations
	setStatus.resolver,
	// types
	UserType.resolver,
]);
github RocketChat / Rocket.Chat / packages / rocketchat-graphql / server / resolvers / accounts / index.js View on Github external
import { createJSAccountsGraphQL } from '@accounts/graphql-api';
import { AccountsServer } from 'meteor/rocketchat:accounts';
import { mergeTypes, mergeResolvers } from 'merge-graphql-schemas';

// queries
import * as oauthProviders from './oauthProviders';
// types
import * as OauthProviderType from './OauthProvider-type';

const accountsGraphQL = createJSAccountsGraphQL(AccountsServer);

export const schema = mergeTypes([
	accountsGraphQL.schema,
	oauthProviders.schema,
	OauthProviderType.schema,
]);

export const resolvers = mergeResolvers([
	accountsGraphQL.extendWithResolvers({}),
	oauthProviders.resolver,
]);
github HigoRibeiro / adonis-gql / src / Server / index.js View on Github external
_loadTypes () {
    ResolverManager.schemas.forEach(schema => {
      this._schemas.push(schema.transform())
    })

    this.$schemas = mergeTypes(this._schemas)
  }
github vesper-framework / vesper / src / SchemaBuilder.ts View on Github external
async buildOnlySchema() {
        const schemaTypes = this.loadSchemaTypes();
        return makeExecutableSchema({
            typeDefs: "scalar Date \r\n scalar Upload \r\n" + mergeTypes(schemaTypes) + "\r\n" + (this.options.customTypeDefs || ""),
        });
    }
github BengBu-YueZhang / learn-graphql / server / schemas / index.js View on Github external
const { mergeTypes } = require('merge-graphql-schemas')
const NoteSchema = require('./note.schema')
const UserSchema = require('./user.schema')
const CommonSchema = require('./common.schema')

const schemas = [
  NoteSchema,
  UserSchema,
  CommonSchema
]

module.exports = mergeTypes(schemas, { all: true })
github d3xter666 / ui5con-2019-mean-stack-with-ui5 / backend / graphql / types / index.js View on Github external
(function (global, module) {

	const {mergeTypes} = require("merge-graphql-schemas");
	const Record = require("./Record/index");

	const typeDefs = [Record];

	module.exports = mergeTypes(typeDefs, {all: true});
}(this, module));
github connect-foundation / 2019-13 / back / src / schema.js View on Github external
import path from 'path';
import { makeExecutableSchema } from 'graphql-tools';
import { fileLoader, mergeResolvers, mergeTypes } from 'merge-graphql-schemas';


const allTypes = fileLoader(path.join(__dirname, 'api/**/*.graphql'));
const allResolvers = fileLoader(path.join(__dirname, 'api/**/*.js'));

const schema = makeExecutableSchema({
  typeDefs: mergeTypes(allTypes),
  resolvers: mergeResolvers(allResolvers),
});
export default schema;
github tomyitav / graphql-server-seed / graphql / schema / schema.js View on Github external
import path from "path";
import { makeExecutableSchema } from 'graphql-tools';
import { fileLoader, mergeTypes, mergeResolvers } from 'merge-graphql-schemas';

const typesArray = fileLoader(path.join(__dirname, '../types'), { recursive: true });
const resolversArray = fileLoader(path.join(__dirname, '../resolvers'));
const allTypes = mergeTypes(typesArray);
const allResolvers = mergeResolvers(resolversArray);
const schema = makeExecutableSchema({
    typeDefs: allTypes,
    resolvers: allResolvers
});

export default schema;

merge-graphql-schemas

A utility library to facilitate merging of modularized GraphQL schemas and resolver objects.

MIT
Latest version published 5 years ago

Package Health Score

47 / 100
Full package analysis