@teambit/graphql 1.0.561 → 1.0.562
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/graphql.main.runtime.d.ts +3 -2
- package/dist/graphql.main.runtime.js +7 -3
- package/dist/graphql.main.runtime.js.map +1 -1
- package/dist/graphql.spec.d.ts +1 -0
- package/dist/graphql.spec.js +79 -0
- package/dist/graphql.spec.js.map +1 -0
- package/dist/{preview-1741144729106.js → preview-1741231104210.js} +2 -2
- package/package.json +15 -7
@@ -75,11 +75,12 @@ export declare class GraphqlMain {
|
|
75
75
|
/**
|
76
76
|
* returns the schema for a specific aspect by its id.
|
77
77
|
*/
|
78
|
-
getSchema(aspectId: string): Schema |
|
78
|
+
getSchema(aspectId: string): Schema | undefined;
|
79
79
|
/**
|
80
80
|
* get multiple schema by aspect ids.
|
81
|
+
* used by the cloud.
|
81
82
|
*/
|
82
|
-
getSchemas(aspectIds: string[]):
|
83
|
+
getSchemas(aspectIds: string[]): Schema[];
|
83
84
|
createServer(options: GraphQLServerOptions): Promise<Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>>;
|
84
85
|
/**
|
85
86
|
* register a new graphql server.
|
@@ -173,17 +173,21 @@ class GraphqlMain {
|
|
173
173
|
* returns the schema for a specific aspect by its id.
|
174
174
|
*/
|
175
175
|
getSchema(aspectId) {
|
176
|
-
|
176
|
+
const schemaOrFunc = this.moduleSlot.get(aspectId);
|
177
|
+
if (!schemaOrFunc) return undefined;
|
178
|
+
const schema = typeof schemaOrFunc === 'function' ? schemaOrFunc() : schemaOrFunc;
|
179
|
+
return schema;
|
177
180
|
}
|
178
181
|
|
179
182
|
/**
|
180
183
|
* get multiple schema by aspect ids.
|
184
|
+
* used by the cloud.
|
181
185
|
*/
|
182
186
|
getSchemas(aspectIds) {
|
183
187
|
return this.moduleSlot.toArray().filter(([aspectId]) => {
|
184
188
|
return aspectIds.includes(aspectId);
|
185
|
-
}).map(([,
|
186
|
-
return
|
189
|
+
}).map(([, schemaOrFunc]) => {
|
190
|
+
return typeof schemaOrFunc === 'function' ? schemaOrFunc() : schemaOrFunc;
|
187
191
|
});
|
188
192
|
}
|
189
193
|
async createServer(options) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_schema","data","require","_graphqlDisableIntrospection","_interopRequireDefault","_core","_cli","_harmony","_logger","_express","_expressGraphql","_toolboxNetwork","_graphql","_graphqlSubscriptions","_http","_httpProxy","_subscriptionsTransportWs","_cors","_createRemoteSchemas","_graphql2","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","Verb","exports","GraphqlMain","constructor","config","moduleSlot","context","logger","graphQLServerSlot","pubSubSlot","Map","pubsub","pubSubSlots","values","PubSub","getSchema","aspectId","get","getSchemas","aspectIds","toArray","includes","map","schema","createServer","options","graphiql","disableIntrospection","localSchema","createRootModule","schemaSlot","remoteSchemas","createRemoteSchemas","schemas","concat","x","mergeSchemas","app","express","disableCors","use","cors","origin","callback","credentials","graphqlHTTP","request","res","params","customFormatErrorFn","err","error","assign","ERR_CODE","originalError","errors","name","HTTP_CODE","code","rootValue","validationRules","NoIntrospection","undefined","server","subscriptionsPort","subscriptionsPortRange","subscriptionServerPort","getPort","port","createSubscription","proxySubscription","registerServer","register","registerPubSub","Error","listen","serverPort","subServer","info","subscriptionsPath","range","from","to","Port","websocketServer","response","writeHead","end","debug","SubscriptionServer","execute","subscribe","onConnect","onWsConnect","path","proxServer","httpProxy","createProxyServer","on","req","socket","head","url","ws","target","host","modules","buildModules","GraphQLModule","imports","schemaSlots","extensionId","schemaOrFunc","moduleDeps","getModuleDependencies","module","typeDefs","resolvers","schemaDirectives","session","verb","headers","READ","set","extension","extensions","deps","getDependencies","ids","dep","id","Array","entries","depId","provider","loggerFactory","createLogger","GraphqlAspect","graphqlMain","Slot","withType","MainRuntime","LoggerAspect","addRuntime"],"sources":["graphql.main.runtime.ts"],"sourcesContent":["import { mergeSchemas } from '@graphql-tools/schema';\nimport NoIntrospection from 'graphql-disable-introspection';\nimport { GraphQLModule } from '@graphql-modules/core';\nimport { MainRuntime } from '@teambit/cli';\nimport { Harmony, Slot, SlotRegistry } from '@teambit/harmony';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport express, { Express } from 'express';\nimport { graphqlHTTP } from 'express-graphql';\nimport { Port } from '@teambit/toolbox.network.get-port';\nimport { execute, subscribe } from 'graphql';\nimport { PubSubEngine, PubSub } from 'graphql-subscriptions';\nimport { createServer, Server } from 'http';\nimport httpProxy from 'http-proxy';\nimport { SubscriptionServer } from 'subscriptions-transport-ws';\nimport cors from 'cors';\nimport { GraphQLServer } from './graphql-server';\nimport { createRemoteSchemas } from './create-remote-schemas';\nimport { GraphqlAspect } from './graphql.aspect';\nimport { Schema } from './schema';\n\nexport enum Verb {\n WRITE = 'write',\n READ = 'read',\n}\n\nexport type GraphQLConfig = {\n port: number;\n subscriptionsPortRange: number[];\n subscriptionsPath: string;\n disableCors?: boolean;\n};\n\nexport type GraphQLServerSlot = SlotRegistry<GraphQLServer>;\n\nexport type SchemaSlot = SlotRegistry<Schema | (() => Schema)>;\n\nexport type PubSubSlot = SlotRegistry<PubSubEngine>;\n\nexport type GraphQLServerOptions = {\n schemaSlot?: SchemaSlot;\n app?: Express;\n graphiql?: boolean;\n disableIntrospection?: boolean;\n remoteSchemas?: GraphQLServer[];\n subscriptionsPortRange?: number[];\n onWsConnect?: Function;\n};\n\nexport class GraphqlMain {\n constructor(\n /**\n * extension config\n */\n readonly config: GraphQLConfig,\n\n /**\n * slot for registering graphql modules\n */\n private moduleSlot: SchemaSlot,\n\n /**\n * harmony context.\n */\n private context: Harmony,\n\n /**\n * logger extension.\n */\n readonly logger: Logger,\n\n private graphQLServerSlot: GraphQLServerSlot,\n\n /**\n * graphql pubsub. allows to emit events to clients.\n */\n private pubSubSlot: PubSubSlot\n ) {}\n\n get pubsub(): PubSubEngine {\n const pubSubSlots = this.pubSubSlot.values();\n if (pubSubSlots.length) return pubSubSlots[0];\n return new PubSub();\n }\n\n private modules = new Map<string, GraphQLModule>();\n\n /**\n * returns the schema for a specific aspect by its id.\n */\n getSchema(aspectId: string) {\n return this.moduleSlot.get(aspectId);\n }\n\n /**\n * get multiple schema by aspect ids.\n */\n getSchemas(aspectIds: string[]) {\n return this.moduleSlot\n .toArray()\n .filter(([aspectId]) => {\n return aspectIds.includes(aspectId);\n })\n .map(([, schema]) => {\n return schema;\n });\n }\n\n async createServer(options: GraphQLServerOptions) {\n const { graphiql = true, disableIntrospection } = options;\n const localSchema = this.createRootModule(options.schemaSlot);\n const remoteSchemas = await createRemoteSchemas(options.remoteSchemas || this.graphQLServerSlot.values());\n const schemas = [localSchema.schema].concat(remoteSchemas).filter((x) => x);\n const schema = mergeSchemas({\n schemas,\n });\n\n // TODO: @guy please consider to refactor to express extension.\n const app = options.app || express();\n if (!this.config.disableCors) {\n app.use(\n // @ts-ignore todo: it's not clear what's the issue.\n cors({\n origin(origin, callback) {\n callback(null, true);\n },\n credentials: true,\n })\n );\n }\n\n app.use(\n '/graphql',\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n graphqlHTTP((request, res, params) => ({\n customFormatErrorFn: (err) => {\n this.logger.error('graphql got an error during running the following query:', params);\n this.logger.error('graphql error ', err);\n return Object.assign(err, {\n // @ts-ignore\n ERR_CODE: err?.originalError?.errors?.[0].ERR_CODE || err.originalError?.constructor?.name,\n // @ts-ignore\n HTTP_CODE: err?.originalError?.errors?.[0].HTTP_CODE || err.originalError?.code,\n });\n },\n schema,\n rootValue: request,\n graphiql,\n validationRules: disableIntrospection ? [NoIntrospection] : undefined,\n }))\n );\n\n const server = createServer(app);\n const subscriptionsPort = options.subscriptionsPortRange || this.config.subscriptionsPortRange;\n const subscriptionServerPort = await this.getPort(subscriptionsPort);\n const { port } = await this.createSubscription(options, subscriptionServerPort);\n this.proxySubscription(server, port);\n\n return server;\n }\n\n /**\n * register a new graphql server.\n */\n registerServer(server: GraphQLServer) {\n this.graphQLServerSlot.register(server);\n return this;\n }\n\n /**\n * register a pubsub client\n */\n registerPubSub(pubsub: PubSubEngine) {\n const pubSubSlots = this.pubSubSlot.toArray();\n if (pubSubSlots.length) throw new Error('can not register more then one pubsub provider');\n this.pubSubSlot.register(pubsub);\n return this;\n }\n\n /**\n * start a graphql server.\n */\n async listen(port?: number, server?: Server, app?: Express) {\n const serverPort = port || this.config.port;\n const subServer = server || (await this.createServer({ app }));\n\n subServer.listen(serverPort, () => {\n this.logger.info(`API Server over HTTP is now running on http://localhost:${serverPort}`);\n this.logger.info(\n `API Server over web socket with subscriptions is now running on ws://localhost:${serverPort}/${this.config.subscriptionsPath}`\n );\n });\n }\n\n /**\n * register a new graphql module.\n * @param schema a function that returns Schema. avoid passing the Schema directly, it's supported only for backward\n * compatibility but really bad for performance. it pulls the entire graphql library.\n */\n register(schema: Schema | (() => Schema)) {\n // const module = new GraphQLModule(schema);\n this.moduleSlot.register(schema);\n return this;\n }\n\n private async getPort(range: number[]) {\n const [from, to] = range;\n return Port.getPort(from, to);\n }\n\n /** create Subscription server with different port */\n\n private async createSubscription(options: GraphQLServerOptions, port: number) {\n // Create WebSocket listener server\n const websocketServer = createServer((request, response) => {\n response.writeHead(404);\n response.end();\n });\n\n // Bind it to port and start listening\n websocketServer.listen(port, () =>\n this.logger.debug(`Websocket Server is now running on http://localhost:${port}`)\n );\n\n const localSchema = this.createRootModule(options.schemaSlot);\n const remoteSchemas = await createRemoteSchemas(options.remoteSchemas || this.graphQLServerSlot.values());\n const schemas = [localSchema.schema].concat(remoteSchemas).filter((x) => x);\n const schema = mergeSchemas({\n schemas,\n });\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const subServer = new SubscriptionServer(\n {\n execute,\n subscribe,\n schema,\n onConnect: options.onWsConnect,\n },\n {\n server: websocketServer,\n path: this.config.subscriptionsPath,\n }\n );\n return { subServer, port };\n }\n /** proxy ws Subscription server to avoid conflict with different websocket connections */\n\n private proxySubscription(server: Server, port: number) {\n const proxServer = httpProxy.createProxyServer();\n const subscriptionsPath = this.config.subscriptionsPath;\n server.on('upgrade', function (req, socket, head) {\n if (req.url === subscriptionsPath) {\n proxServer.ws(req, socket, head, { target: { host: 'localhost', port } });\n }\n });\n }\n\n private createRootModule(schemaSlot?: SchemaSlot) {\n const modules = this.buildModules(schemaSlot);\n\n return new GraphQLModule({\n imports: modules,\n });\n }\n\n private buildModules(schemaSlot?: SchemaSlot) {\n const schemaSlots = schemaSlot ? schemaSlot.toArray() : this.moduleSlot.toArray();\n return schemaSlots.map(([extensionId, schemaOrFunc]) => {\n const schema = typeof schemaOrFunc === 'function' ? schemaOrFunc() : schemaOrFunc;\n const moduleDeps = this.getModuleDependencies(extensionId);\n\n const module = new GraphQLModule({\n typeDefs: schema.typeDefs,\n resolvers: schema.resolvers,\n schemaDirectives: schema.schemaDirectives,\n imports: moduleDeps,\n context: (session) => {\n return {\n ...session,\n verb: session?.headers?.['x-verb'] || Verb.READ,\n };\n },\n });\n\n this.modules.set(extensionId, module);\n\n return module;\n });\n }\n\n private getModuleDependencies(extensionId: string): GraphQLModule[] {\n const extension = this.context.extensions.get(extensionId);\n if (!extension) throw new Error(`aspect ${extensionId} was not found`);\n const deps = this.context.getDependencies(extension);\n const ids = deps.map((dep) => dep.id);\n\n // @ts-ignore check :TODO why types are breaking here.\n return Array.from(this.modules.entries())\n .map(([depId, module]) => {\n const dep = ids.includes(depId);\n if (!dep) return undefined;\n return module;\n })\n .filter((module) => !!module);\n }\n\n static slots = [Slot.withType<Schema>(), Slot.withType<GraphQLServer>(), Slot.withType<PubSubSlot>()];\n\n static defaultConfig = {\n port: 4000,\n subscriptionsPortRange: [2000, 2100],\n disableCors: false,\n subscriptionsPath: '/subscriptions',\n };\n\n static runtime = MainRuntime;\n static dependencies = [LoggerAspect];\n\n static async provider(\n [loggerFactory]: [LoggerMain],\n config: GraphQLConfig,\n [moduleSlot, graphQLServerSlot, pubSubSlot]: [SchemaSlot, GraphQLServerSlot, PubSubSlot],\n context: Harmony\n ) {\n const logger = loggerFactory.createLogger(GraphqlAspect.id);\n const graphqlMain = new GraphqlMain(config, moduleSlot, context, logger, graphQLServerSlot, pubSubSlot);\n graphqlMain.registerPubSub(new PubSub());\n return graphqlMain;\n }\n}\n\nGraphqlAspect.addRuntime(GraphqlMain);\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,6BAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,4BAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,KAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,IAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAO,QAAA,YAAA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opRequireDefault","_core","_cli","_harmony","_logger","_express","_expressGraphql","_toolboxNetwork","_graphql","_graphqlSubscriptions","_http","_httpProxy","_subscriptionsTransportWs","_cors","_createRemoteSchemas","_graphql2","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","Verb","exports","GraphqlMain","constructor","config","moduleSlot","context","logger","graphQLServerSlot","pubSubSlot","Map","pubsub","pubSubSlots","values","PubSub","getSchema","aspectId","schemaOrFunc","get","undefined","schema","getSchemas","aspectIds","toArray","includes","map","createServer","options","graphiql","disableIntrospection","localSchema","createRootModule","schemaSlot","remoteSchemas","createRemoteSchemas","schemas","concat","x","mergeSchemas","app","express","disableCors","use","cors","origin","callback","credentials","graphqlHTTP","request","res","params","customFormatErrorFn","err","error","assign","ERR_CODE","originalError","errors","name","HTTP_CODE","code","rootValue","validationRules","NoIntrospection","server","subscriptionsPort","subscriptionsPortRange","subscriptionServerPort","getPort","port","createSubscription","proxySubscription","registerServer","register","registerPubSub","Error","listen","serverPort","subServer","info","subscriptionsPath","range","from","to","Port","websocketServer","response","writeHead","end","debug","SubscriptionServer","execute","subscribe","onConnect","onWsConnect","path","proxServer","httpProxy","createProxyServer","on","req","socket","head","url","ws","target","host","modules","buildModules","GraphQLModule","imports","schemaSlots","extensionId","moduleDeps","getModuleDependencies","module","typeDefs","resolvers","schemaDirectives","session","verb","headers","READ","set","extension","extensions","deps","getDependencies","ids","dep","id","Array","entries","depId","provider","loggerFactory","createLogger","GraphqlAspect","graphqlMain","Slot","withType","MainRuntime","LoggerAspect","addRuntime"],"sources":["graphql.main.runtime.ts"],"sourcesContent":["import { mergeSchemas } from '@graphql-tools/schema';\nimport NoIntrospection from 'graphql-disable-introspection';\nimport { GraphQLModule } from '@graphql-modules/core';\nimport { MainRuntime } from '@teambit/cli';\nimport { Harmony, Slot, SlotRegistry } from '@teambit/harmony';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport express, { Express } from 'express';\nimport { graphqlHTTP } from 'express-graphql';\nimport { Port } from '@teambit/toolbox.network.get-port';\nimport { execute, subscribe } from 'graphql';\nimport { PubSubEngine, PubSub } from 'graphql-subscriptions';\nimport { createServer, Server } from 'http';\nimport httpProxy from 'http-proxy';\nimport { SubscriptionServer } from 'subscriptions-transport-ws';\nimport cors from 'cors';\nimport { GraphQLServer } from './graphql-server';\nimport { createRemoteSchemas } from './create-remote-schemas';\nimport { GraphqlAspect } from './graphql.aspect';\nimport { Schema } from './schema';\n\nexport enum Verb {\n WRITE = 'write',\n READ = 'read',\n}\n\nexport type GraphQLConfig = {\n port: number;\n subscriptionsPortRange: number[];\n subscriptionsPath: string;\n disableCors?: boolean;\n};\n\nexport type GraphQLServerSlot = SlotRegistry<GraphQLServer>;\n\nexport type SchemaSlot = SlotRegistry<Schema | (() => Schema)>;\n\nexport type PubSubSlot = SlotRegistry<PubSubEngine>;\n\nexport type GraphQLServerOptions = {\n schemaSlot?: SchemaSlot;\n app?: Express;\n graphiql?: boolean;\n disableIntrospection?: boolean;\n remoteSchemas?: GraphQLServer[];\n subscriptionsPortRange?: number[];\n onWsConnect?: Function;\n};\n\nexport class GraphqlMain {\n constructor(\n /**\n * extension config\n */\n readonly config: GraphQLConfig,\n\n /**\n * slot for registering graphql modules\n */\n private moduleSlot: SchemaSlot,\n\n /**\n * harmony context.\n */\n private context: Harmony,\n\n /**\n * logger extension.\n */\n readonly logger: Logger,\n\n private graphQLServerSlot: GraphQLServerSlot,\n\n /**\n * graphql pubsub. allows to emit events to clients.\n */\n private pubSubSlot: PubSubSlot\n ) {}\n\n get pubsub(): PubSubEngine {\n const pubSubSlots = this.pubSubSlot.values();\n if (pubSubSlots.length) return pubSubSlots[0];\n return new PubSub();\n }\n\n private modules = new Map<string, GraphQLModule>();\n\n /**\n * returns the schema for a specific aspect by its id.\n */\n getSchema(aspectId: string): Schema | undefined {\n const schemaOrFunc = this.moduleSlot.get(aspectId);\n if (!schemaOrFunc) return undefined;\n const schema = typeof schemaOrFunc === 'function' ? schemaOrFunc() : schemaOrFunc;\n return schema;\n }\n\n /**\n * get multiple schema by aspect ids.\n * used by the cloud.\n */\n getSchemas(aspectIds: string[]): Schema[] {\n return this.moduleSlot\n .toArray()\n .filter(([aspectId]) => {\n return aspectIds.includes(aspectId);\n })\n .map(([, schemaOrFunc]) => {\n return typeof schemaOrFunc === 'function' ? schemaOrFunc() : schemaOrFunc;\n });\n }\n\n async createServer(options: GraphQLServerOptions) {\n const { graphiql = true, disableIntrospection } = options;\n const localSchema = this.createRootModule(options.schemaSlot);\n const remoteSchemas = await createRemoteSchemas(options.remoteSchemas || this.graphQLServerSlot.values());\n const schemas = [localSchema.schema].concat(remoteSchemas).filter((x) => x);\n const schema = mergeSchemas({\n schemas,\n });\n\n // TODO: @guy please consider to refactor to express extension.\n const app = options.app || express();\n if (!this.config.disableCors) {\n app.use(\n // @ts-ignore todo: it's not clear what's the issue.\n cors({\n origin(origin, callback) {\n callback(null, true);\n },\n credentials: true,\n })\n );\n }\n\n app.use(\n '/graphql',\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n graphqlHTTP((request, res, params) => ({\n customFormatErrorFn: (err) => {\n this.logger.error('graphql got an error during running the following query:', params);\n this.logger.error('graphql error ', err);\n return Object.assign(err, {\n // @ts-ignore\n ERR_CODE: err?.originalError?.errors?.[0].ERR_CODE || err.originalError?.constructor?.name,\n // @ts-ignore\n HTTP_CODE: err?.originalError?.errors?.[0].HTTP_CODE || err.originalError?.code,\n });\n },\n schema,\n rootValue: request,\n graphiql,\n validationRules: disableIntrospection ? [NoIntrospection] : undefined,\n }))\n );\n\n const server = createServer(app);\n const subscriptionsPort = options.subscriptionsPortRange || this.config.subscriptionsPortRange;\n const subscriptionServerPort = await this.getPort(subscriptionsPort);\n const { port } = await this.createSubscription(options, subscriptionServerPort);\n this.proxySubscription(server, port);\n\n return server;\n }\n\n /**\n * register a new graphql server.\n */\n registerServer(server: GraphQLServer) {\n this.graphQLServerSlot.register(server);\n return this;\n }\n\n /**\n * register a pubsub client\n */\n registerPubSub(pubsub: PubSubEngine) {\n const pubSubSlots = this.pubSubSlot.toArray();\n if (pubSubSlots.length) throw new Error('can not register more then one pubsub provider');\n this.pubSubSlot.register(pubsub);\n return this;\n }\n\n /**\n * start a graphql server.\n */\n async listen(port?: number, server?: Server, app?: Express) {\n const serverPort = port || this.config.port;\n const subServer = server || (await this.createServer({ app }));\n\n subServer.listen(serverPort, () => {\n this.logger.info(`API Server over HTTP is now running on http://localhost:${serverPort}`);\n this.logger.info(\n `API Server over web socket with subscriptions is now running on ws://localhost:${serverPort}/${this.config.subscriptionsPath}`\n );\n });\n }\n\n /**\n * register a new graphql module.\n * @param schema a function that returns Schema. avoid passing the Schema directly, it's supported only for backward\n * compatibility but really bad for performance. it pulls the entire graphql library.\n */\n register(schema: Schema | (() => Schema)) {\n // const module = new GraphQLModule(schema);\n this.moduleSlot.register(schema);\n return this;\n }\n\n private async getPort(range: number[]) {\n const [from, to] = range;\n return Port.getPort(from, to);\n }\n\n /** create Subscription server with different port */\n\n private async createSubscription(options: GraphQLServerOptions, port: number) {\n // Create WebSocket listener server\n const websocketServer = createServer((request, response) => {\n response.writeHead(404);\n response.end();\n });\n\n // Bind it to port and start listening\n websocketServer.listen(port, () =>\n this.logger.debug(`Websocket Server is now running on http://localhost:${port}`)\n );\n\n const localSchema = this.createRootModule(options.schemaSlot);\n const remoteSchemas = await createRemoteSchemas(options.remoteSchemas || this.graphQLServerSlot.values());\n const schemas = [localSchema.schema].concat(remoteSchemas).filter((x) => x);\n const schema = mergeSchemas({\n schemas,\n });\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const subServer = new SubscriptionServer(\n {\n execute,\n subscribe,\n schema,\n onConnect: options.onWsConnect,\n },\n {\n server: websocketServer,\n path: this.config.subscriptionsPath,\n }\n );\n return { subServer, port };\n }\n /** proxy ws Subscription server to avoid conflict with different websocket connections */\n\n private proxySubscription(server: Server, port: number) {\n const proxServer = httpProxy.createProxyServer();\n const subscriptionsPath = this.config.subscriptionsPath;\n server.on('upgrade', function (req, socket, head) {\n if (req.url === subscriptionsPath) {\n proxServer.ws(req, socket, head, { target: { host: 'localhost', port } });\n }\n });\n }\n\n private createRootModule(schemaSlot?: SchemaSlot) {\n const modules = this.buildModules(schemaSlot);\n\n return new GraphQLModule({\n imports: modules,\n });\n }\n\n private buildModules(schemaSlot?: SchemaSlot) {\n const schemaSlots = schemaSlot ? schemaSlot.toArray() : this.moduleSlot.toArray();\n return schemaSlots.map(([extensionId, schemaOrFunc]) => {\n const schema = typeof schemaOrFunc === 'function' ? schemaOrFunc() : schemaOrFunc;\n const moduleDeps = this.getModuleDependencies(extensionId);\n\n const module = new GraphQLModule({\n typeDefs: schema.typeDefs,\n resolvers: schema.resolvers,\n schemaDirectives: schema.schemaDirectives,\n imports: moduleDeps,\n context: (session) => {\n return {\n ...session,\n verb: session?.headers?.['x-verb'] || Verb.READ,\n };\n },\n });\n\n this.modules.set(extensionId, module);\n\n return module;\n });\n }\n\n private getModuleDependencies(extensionId: string): GraphQLModule[] {\n const extension = this.context.extensions.get(extensionId);\n if (!extension) throw new Error(`aspect ${extensionId} was not found`);\n const deps = this.context.getDependencies(extension);\n const ids = deps.map((dep) => dep.id);\n\n // @ts-ignore check :TODO why types are breaking here.\n return Array.from(this.modules.entries())\n .map(([depId, module]) => {\n const dep = ids.includes(depId);\n if (!dep) return undefined;\n return module;\n })\n .filter((module) => !!module);\n }\n\n static slots = [Slot.withType<Schema>(), Slot.withType<GraphQLServer>(), Slot.withType<PubSubSlot>()];\n\n static defaultConfig = {\n port: 4000,\n subscriptionsPortRange: [2000, 2100],\n disableCors: false,\n subscriptionsPath: '/subscriptions',\n };\n\n static runtime = MainRuntime;\n static dependencies = [LoggerAspect];\n\n static async provider(\n [loggerFactory]: [LoggerMain],\n config: GraphQLConfig,\n [moduleSlot, graphQLServerSlot, pubSubSlot]: [SchemaSlot, GraphQLServerSlot, PubSubSlot],\n context: Harmony\n ) {\n const logger = loggerFactory.createLogger(GraphqlAspect.id);\n const graphqlMain = new GraphqlMain(config, moduleSlot, context, logger, graphQLServerSlot, pubSubSlot);\n graphqlMain.registerPubSub(new PubSub());\n return graphqlMain;\n }\n}\n\nGraphqlAspect.addRuntime(GraphqlMain);\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,6BAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,4BAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,KAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,IAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAO,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA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W,aA+QL2I,kBAAW;AAAA7J,eAAA,CA/QjBkB,WAAW,kBAgRA,CAAC4I,sBAAY,CAAC;AAetCL,yBAAa,CAACM,UAAU,CAAC7I,WAAW,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,79 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _chai() {
|
4
|
+
const data = _interopRequireWildcard(require("chai"));
|
5
|
+
_chai = function () {
|
6
|
+
return data;
|
7
|
+
};
|
8
|
+
return data;
|
9
|
+
}
|
10
|
+
function _harmonyTesting() {
|
11
|
+
const data = require("@teambit/harmony.testing.load-aspect");
|
12
|
+
_harmonyTesting = function () {
|
13
|
+
return data;
|
14
|
+
};
|
15
|
+
return data;
|
16
|
+
}
|
17
|
+
function _workspace() {
|
18
|
+
const data = require("@teambit/workspace");
|
19
|
+
_workspace = function () {
|
20
|
+
return data;
|
21
|
+
};
|
22
|
+
return data;
|
23
|
+
}
|
24
|
+
function _workspaceTesting() {
|
25
|
+
const data = require("@teambit/workspace.testing.mock-workspace");
|
26
|
+
_workspaceTesting = function () {
|
27
|
+
return data;
|
28
|
+
};
|
29
|
+
return data;
|
30
|
+
}
|
31
|
+
function _graphql() {
|
32
|
+
const data = require("./graphql.aspect");
|
33
|
+
_graphql = function () {
|
34
|
+
return data;
|
35
|
+
};
|
36
|
+
return data;
|
37
|
+
}
|
38
|
+
function _lanes() {
|
39
|
+
const data = require("@teambit/lanes");
|
40
|
+
_lanes = function () {
|
41
|
+
return data;
|
42
|
+
};
|
43
|
+
return data;
|
44
|
+
}
|
45
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
46
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
47
|
+
_chai().default.use(require('chai-fs'));
|
48
|
+
describe('GraphQL Aspect', function () {
|
49
|
+
this.timeout(0);
|
50
|
+
describe('getSchemas and getSchema APIs', () => {
|
51
|
+
let graphql;
|
52
|
+
let workspaceData;
|
53
|
+
before(async () => {
|
54
|
+
workspaceData = (0, _workspaceTesting().mockWorkspace)();
|
55
|
+
const {
|
56
|
+
workspacePath
|
57
|
+
} = workspaceData;
|
58
|
+
const harmony = await (0, _harmonyTesting().loadManyAspects)([_workspace().WorkspaceAspect, _graphql().GraphqlAspect, _lanes().LanesAspect], workspacePath);
|
59
|
+
graphql = harmony.get(_graphql().GraphqlAspect.id);
|
60
|
+
});
|
61
|
+
after(async () => {
|
62
|
+
await (0, _workspaceTesting().destroyWorkspace)(workspaceData);
|
63
|
+
});
|
64
|
+
it('should bring the schemas when calling getSchemas API', async () => {
|
65
|
+
const schemas = graphql.getSchemas([_lanes().LanesAspect.id]);
|
66
|
+
(0, _chai().expect)(schemas).to.be.an('array');
|
67
|
+
(0, _chai().expect)(schemas).to.have.lengthOf(1);
|
68
|
+
(0, _chai().expect)(schemas[0]).to.be.an('object');
|
69
|
+
(0, _chai().expect)(schemas[0]).to.not.be.an('function');
|
70
|
+
});
|
71
|
+
it('should bring the schemas when calling getSchema API', async () => {
|
72
|
+
const schema = graphql.getSchema(_lanes().LanesAspect.id);
|
73
|
+
(0, _chai().expect)(schema).to.be.an('object');
|
74
|
+
(0, _chai().expect)(schema).to.not.be.an('function');
|
75
|
+
});
|
76
|
+
});
|
77
|
+
});
|
78
|
+
|
79
|
+
//# sourceMappingURL=graphql.spec.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_chai","data","_interopRequireWildcard","require","_harmonyTesting","_workspace","_workspaceTesting","_graphql","_lanes","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","chai","use","describe","timeout","graphql","workspaceData","before","mockWorkspace","workspacePath","harmony","loadManyAspects","WorkspaceAspect","GraphqlAspect","LanesAspect","id","after","destroyWorkspace","it","schemas","getSchemas","expect","to","be","an","have","lengthOf","not","schema","getSchema"],"sources":["graphql.spec.ts"],"sourcesContent":["import chai, { expect } from 'chai';\nimport { loadManyAspects } from '@teambit/harmony.testing.load-aspect';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport { mockWorkspace, destroyWorkspace, WorkspaceData } from '@teambit/workspace.testing.mock-workspace';\nimport { GraphqlAspect } from './graphql.aspect';\nimport { GraphqlMain } from './graphql.main.runtime';\nimport { LanesAspect } from '@teambit/lanes';\n\nchai.use(require('chai-fs'));\n\ndescribe('GraphQL Aspect', function () {\n this.timeout(0);\n\n describe('getSchemas and getSchema APIs', () => {\n let graphql: GraphqlMain;\n let workspaceData: WorkspaceData;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n const harmony = await loadManyAspects([WorkspaceAspect, GraphqlAspect, LanesAspect], workspacePath);\n graphql = harmony.get<GraphqlMain>(GraphqlAspect.id);\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n it('should bring the schemas when calling getSchemas API', async () => {\n const schemas = graphql.getSchemas([LanesAspect.id]);\n expect(schemas).to.be.an('array');\n expect(schemas).to.have.lengthOf(1);\n expect(schemas[0]).to.be.an('object');\n expect(schemas[0]).to.not.be.an('function');\n });\n it('should bring the schemas when calling getSchema API', async () => {\n const schema = graphql.getSchema(LanesAspect.id);\n expect(schema).to.be.an('object');\n expect(schema).to.not.be.an('function');\n });\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAA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AC;IACvC,CAAC,CAAC;IACFY,EAAE,CAAC,sDAAsD,EAAE,YAAY;MACrE,MAAMC,OAAO,GAAGd,OAAO,CAACe,UAAU,CAAC,CAACN,oBAAW,CAACC,EAAE,CAAC,CAAC;MACpD,IAAAM,cAAM,EAACF,OAAO,CAAC,CAACG,EAAE,CAACC,EAAE,CAACC,EAAE,CAAC,OAAO,CAAC;MACjC,IAAAH,cAAM,EAACF,OAAO,CAAC,CAACG,EAAE,CAACG,IAAI,CAACC,QAAQ,CAAC,CAAC,CAAC;MACnC,IAAAL,cAAM,EAACF,OAAO,CAAC,CAAC,CAAC,CAAC,CAACG,EAAE,CAACC,EAAE,CAACC,EAAE,CAAC,QAAQ,CAAC;MACrC,IAAAH,cAAM,EAACF,OAAO,CAAC,CAAC,CAAC,CAAC,CAACG,EAAE,CAACK,GAAG,CAACJ,EAAE,CAACC,EAAE,CAAC,UAAU,CAAC;IAC7C,CAAC,CAAC;IACFN,EAAE,CAAC,qDAAqD,EAAE,YAAY;MACpE,MAAMU,MAAM,GAAGvB,OAAO,CAACwB,SAAS,CAACf,oBAAW,CAACC,EAAE,CAAC;MAChD,IAAAM,cAAM,EAACO,MAAM,CAAC,CAACN,EAAE,CAACC,EAAE,CAACC,EAAE,CAAC,QAAQ,CAAC;MACjC,IAAAH,cAAM,EAACO,MAAM,CAAC,CAACN,EAAE,CAACK,GAAG,CAACJ,EAAE,CAACC,EAAE,CAAC,UAAU,CAAC;IACzC,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_graphql@1.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_graphql@1.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_graphql@1.0.562/dist/graphql.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_graphql@1.0.562/dist/graphql.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/graphql",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.562",
|
4
4
|
"homepage": "https://bit.cloud/teambit/harmony/graphql",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.harmony",
|
8
8
|
"name": "graphql",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.562"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"@graphql-modules/core": "0.7.17",
|
@@ -32,10 +32,10 @@
|
|
32
32
|
"bufferutil": "4.0.3",
|
33
33
|
"@teambit/harmony": "0.4.7",
|
34
34
|
"@teambit/ui-foundation.ui.is-browser": "0.0.500",
|
35
|
-
"@teambit/cli": "0.0.
|
36
|
-
"@teambit/logger": "0.0.
|
35
|
+
"@teambit/cli": "0.0.1139",
|
36
|
+
"@teambit/logger": "0.0.1232",
|
37
37
|
"@teambit/toolbox.network.get-port": "1.0.10",
|
38
|
-
"@teambit/ui": "1.0.
|
38
|
+
"@teambit/ui": "1.0.562"
|
39
39
|
},
|
40
40
|
"devDependencies": {
|
41
41
|
"@types/cors": "2.8.10",
|
@@ -43,15 +43,23 @@
|
|
43
43
|
"@types/lodash": "4.14.165",
|
44
44
|
"@types/node-fetch": "2.5.12",
|
45
45
|
"@types/mocha": "9.1.0",
|
46
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.69"
|
46
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.69",
|
47
|
+
"@teambit/harmony.testing.load-aspect": "0.0.297",
|
48
|
+
"@teambit/lanes": "1.0.563",
|
49
|
+
"@teambit/workspace.testing.mock-workspace": "0.0.71",
|
50
|
+
"@teambit/workspace": "1.0.562"
|
47
51
|
},
|
48
52
|
"peerDependencies": {
|
49
53
|
"@apollo/client": "^3.6.0",
|
50
54
|
"react": "^17.0.0 || ^18.0.0",
|
51
55
|
"react-dom": "^17.0.0 || ^18.0.0",
|
56
|
+
"chai": "4.3.0",
|
57
|
+
"chai-fs": "1.0.0",
|
52
58
|
"graphql": "^15.8.0",
|
53
59
|
"@types/react": "^17.0.73",
|
54
|
-
"@types/react-dom": "^17.0.5"
|
60
|
+
"@types/react-dom": "^17.0.5",
|
61
|
+
"@types/chai-fs": "2.0.5",
|
62
|
+
"@types/chai": "4.3.19"
|
55
63
|
},
|
56
64
|
"license": "Apache-2.0",
|
57
65
|
"optionalDependencies": {},
|