{"id":19149281,"url":"https://github.com/restuwahyu13/graphql-typedefs-loader","last_synced_at":"2025-05-07T04:42:56.925Z","repository":{"id":37965350,"uuid":"386915642","full_name":"restuwahyu13/graphql-typedefs-loader","owner":"restuwahyu13","description":"Multiple loader for graphql schema file","archived":false,"fork":false,"pushed_at":"2023-01-30T12:04:57.000Z","size":516,"stargazers_count":6,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T04:42:50.706Z","etag":null,"topics":["graphql","graphql-tools","graphql-typedefs-loader","gtl-node","javascript","loader","node-module","nodejs","typedefs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/restuwahyu13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-17T11:08:21.000Z","updated_at":"2023-03-04T17:59:02.000Z","dependencies_parsed_at":"2023-02-16T07:15:18.964Z","dependency_job_id":null,"html_url":"https://github.com/restuwahyu13/graphql-typedefs-loader","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restuwahyu13%2Fgraphql-typedefs-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restuwahyu13%2Fgraphql-typedefs-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restuwahyu13%2Fgraphql-typedefs-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restuwahyu13%2Fgraphql-typedefs-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/restuwahyu13","download_url":"https://codeload.github.com/restuwahyu13/graphql-typedefs-loader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252816517,"owners_count":21808702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql","graphql-tools","graphql-typedefs-loader","gtl-node","javascript","loader","node-module","nodejs","typedefs","typescript"],"created_at":"2024-11-09T08:07:28.067Z","updated_at":"2025-05-07T04:42:56.904Z","avatar_url":"https://github.com/restuwahyu13.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Graphql Typedefs loader\n\n[![Build Status](https://travis-ci.com/restuwahyu13/graphql-typedefs-loader.svg?branch=main)](https://travis-ci.com/restuwahyu13/graphql-typedefs-loader) [![Coverage Status](https://coveralls.io/repos/github/restuwahyu13/graphql-typedefs-loader/badge.svg?branch=main)](https://coveralls.io/github/restuwahyu13/graphql-typedefs-loader?branch=main) [![codebeat badge](https://codebeat.co/badges/857cbfb1-53a4-41e5-a9a0-38152987a7d4)](https://codebeat.co/projects/github-com-restuwahyu13-graphql-typedefs-loader-main) [![CodeFactor](https://www.codefactor.io/repository/github/restuwahyu13/graphql-typedefs-loader/badge)](https://www.codefactor.io/repository/github/restuwahyu13/graphql-typedefs-loader) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/d368f0998e7641c4a85a796e7dae3f6a)](https://www.codacy.com/gh/restuwahyu13/graphql-typedefs-loader/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=restuwahyu13/graphql-typedefs-loader\u0026amp;utm_campaign=Badge_Grade) ![node-current](https://img.shields.io/node/v/gtl-node?style=flat-square) ![npm](https://img.shields.io/npm/dm/gtl-node) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/restuwahyu13/graphql-typedefs-loader/blob/main/CONTRIBUTING.md)\n\n**Graphql Typedefs Loader** is simple multiple loader schema for GraphQL, you can load many schema files with extension `.graphql or .gql` in your GraphQL project, please check more example usage or demo, how about this module it works.\n\n- [Installation](#installation)\n- [Example Usage](#example-usage)\n- [Testing](#testing)\n- [Bugs](#bugs)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Installation\n\n```bash\n$ npm install gtl-node -S or yarn add gtl-node -S\n```\n\n## Example Usage\n\n  + ##### Example Usage Multiple File Inside Directory\n\n    - ##### Example Usage Using CommonJs\n\n    ```javascript\n      const http from = require('http')\n      const { ApolloServer } = require('apollo-server-express')\n      const { applyMiddleware } = require('graphql-middleware')\n      const { makeExecutableSchema } = require('@graphql-tools/schema')\n      const playground = require('graphql-playground-middleware-express')\n      const express = require('express')\n      // import module like this\n      const { gtl } = require('gtl-node')\n\n      // change with your graphql schema location folder\n      const typeDefs = gtl({ directory: 'graphql/typeDefs', pattern: '**/*', extension: 'graphql' }) \n      const { resolvers } = require('./graphql/resolvers')\n      const graphqlPlayground = playground.default\n\n      (async function () {\n        const apolloServer = new ApolloServer({\n          schema: applyMiddleware(makeExecutableSchema({ typeDefs, resolvers }))\n        })\n\n        const app = express()\n        const server = http.createServer(app)\n\n        app.get('/playground', graphqlPlayground({ endpoint: '/graphql', codeTheme: 'light' }))\n\n        await apolloServer.start()\n        apolloServer.applyMiddleware({ app })\n        server.listen(process.env.PORT || 3000, () =\u003e console.log(`Apollo server running on ${server.address().port}`))\n      })()\n    ```\n\n    - ##### Example Usage Using ES6\n\n    ```javascript\n      import http from 'http'\n      import { ApolloServer } from 'apollo-server-express'\n      import { applyMiddleware } from 'graphql-middleware'\n      import { makeExecutableSchema } from '@graphql-tools/schema'\n      import playground from 'graphql-playground-middleware-express'\n      import express from 'express'\n      // import module like this\n      import { gtl } from 'gtl-node'\n\n      // change with your graphql schema location folder\n      const typeDefs = gtl({ directory: 'graphql/typeDefs', pattern: '**/*', extension: 'graphql' }) \n      const { resolvers } = require('./graphql/resolvers')\n      const graphqlPlayground = playground.default\n\n      (async function () {\n        const apolloServer = new ApolloServer({\n          schema: applyMiddleware(makeExecutableSchema({ typeDefs, resolvers }))\n        })\n\n        const app = express()\n        const server = http.createServer(app)\n\n        app.get('/playground', graphqlPlayground({ endpoint: '/graphql', codeTheme: 'light' }))\n\n        await apolloServer.start()\n        apolloServer.applyMiddleware({ app })\n        server.listen(process.env.PORT || 3000, () =\u003e console.log(`Apollo server running on ${server.address().port}`))\n      })()\n    ```\n  + ##### Example Usage Multiple File Outside Directory\n\n    - ##### Example Usage Using CommonJs\n\n    ```javascript\n      const http from = require('http')\n      const { ApolloServer } = require('apollo-server-express')\n      const { applyMiddleware } = require('graphql-middleware')\n      const { makeExecutableSchema } = require('@graphql-tools/schema')\n      const playground = require('graphql-playground-middleware-express')\n      const express = require('express')\n      // import module like this\n      const { gtl } = require('gtl-node')\n\n      // change with your graphql schema location folder\n      const typeDefs = gtl({ pattern: '**/*', extension: 'graphql' }) \n      const { resolvers } = require('./graphql/resolvers')\n      const graphqlPlayground = playground.default\n\n      (async function () {\n        const apolloServer = new ApolloServer({\n          schema: applyMiddleware(makeExecutableSchema({ typeDefs, resolvers }))\n        })\n\n        const app = express()\n        const server = http.createServer(app)\n\n        app.get('/playground', graphqlPlayground({ endpoint: '/graphql', codeTheme: 'light' }))\n\n        await apolloServer.start()\n        apolloServer.applyMiddleware({ app })\n        server.listen(process.env.PORT || 3000, () =\u003e console.log(`Apollo server running on ${server.address().port}`))\n      })()\n    ```\n\n    - ##### Example Usage Using ES6\n\n    ```javascript\n      import http from 'http'\n      import { ApolloServer } from 'apollo-server-express'\n      import { applyMiddleware } from 'graphql-middleware'\n      import { makeExecutableSchema } from '@graphql-tools/schema'\n      import playground from 'graphql-playground-middleware-express'\n      import express from 'express'\n      // import module like this\n      import { gtl } from 'gtl-node'\n\n      // change with your graphql schema location folder\n      const typeDefs = gtl({ pattern: '**/*', extension: 'graphql' }) \n      const { resolvers } = require('./graphql/resolvers')\n      const graphqlPlayground = playground.default\n\n      (async function () {\n        const apolloServer = new ApolloServer({\n          schema: applyMiddleware(makeExecutableSchema({ typeDefs, resolvers }))\n        })\n\n        const app = express()\n        const server = http.createServer(app)\n\n        app.get('/playground', graphqlPlayground({ endpoint: '/graphql', codeTheme: 'light' }))\n\n        await apolloServer.start()\n        apolloServer.applyMiddleware({ app })\n        server.listen(process.env.PORT || 3000, () =\u003e console.log(`Apollo server running on ${server.address().port}`))\n      })()\n    ```\n\n  + ##### Example Usage Single File Inside Directory\n\n    - ##### Example Usage Using CommonJs\n\n    ```javascript\n      const http from = require('http')\n      const { ApolloServer } = require('apollo-server-express')\n      const { applyMiddleware } = require('graphql-middleware')\n      const { makeExecutableSchema } = require('@graphql-tools/schema')\n      const playground = require('graphql-playground-middleware-express')\n      const express = require('express')\n      // import module like this\n      const { gtl } = require('gtl-node')\n\n      // change with your graphql schema location folder\n      const typeDefs = gtl({ directory: 'graphql/typedefs' , fileName: 'schema.graphql' }) \n      const { resolvers } = require('./graphql/resolvers')\n      const graphqlPlayground = playground.default\n\n      (async function () {\n        const apolloServer = new ApolloServer({\n          schema: applyMiddleware(makeExecutableSchema({ typeDefs, resolvers }))\n        })\n\n        const app = express()\n        const server = http.createServer(app)\n\n        app.get('/playground', graphqlPlayground({ endpoint: '/graphql', codeTheme: 'light' }))\n\n        await apolloServer.start()\n        apolloServer.applyMiddleware({ app })\n        server.listen(process.env.PORT || 3000, () =\u003e console.log(`Apollo server running on ${server.address().port}`))\n      })()\n    ```\n\n    - ##### Example Usage Using ES6\n\n    ```javascript\n      import http from 'http'\n      import { ApolloServer } from 'apollo-server-express'\n      import { applyMiddleware } from 'graphql-middleware'\n      import { makeExecutableSchema } from '@graphql-tools/schema'\n      import playground from 'graphql-playground-middleware-express'\n      import express from 'express'\n      // import module like this\n      import { gtl } from 'gtl-node'\n\n      // change with your graphql schema location folder\n      const typeDefs = gtl({ directory: 'graphql/typedefs' , fileName: 'schema.graphql' }) \n      const { resolvers } = require('./graphql/resolvers')\n      const graphqlPlayground = playground.default\n\n      (async function () {\n        const apolloServer = new ApolloServer({\n          schema: applyMiddleware(makeExecutableSchema({ typeDefs, resolvers }))\n        })\n\n        const app = express()\n        const server = http.createServer(app)\n\n        app.get('/playground', graphqlPlayground({ endpoint: '/graphql', codeTheme: 'light' }))\n\n        await apolloServer.start()\n        apolloServer.applyMiddleware({ app })\n        server.listen(process.env.PORT || 3000, () =\u003e console.log(`Apollo server running on ${server.address().port}`))\n      })()\n    ```\n\n  + ##### Example Usage Single File Outside Directory\n\n    - ##### Example Usage Using CommonJs\n\n    ```javascript\n      const http from = require('http')\n      const { ApolloServer } = require('apollo-server-express')\n      const { applyMiddleware } = require('graphql-middleware')\n      const { makeExecutableSchema } = require('@graphql-tools/schema')\n      const playground = require('graphql-playground-middleware-express')\n      const express = require('express')\n      // import module like this\n      const { gtl } = require('gtl-node')\n\n      // change with your graphql schema location folder\n      const typeDefs = gtl({ fileName: 'schema.graphql' }) \n      const { resolvers } = require('./graphql/resolvers')\n      const graphqlPlayground = playground.default\n\n      (async function () {\n        const apolloServer = new ApolloServer({\n          schema: applyMiddleware(makeExecutableSchema({ typeDefs, resolvers }))\n        })\n\n        const app = express()\n        const server = http.createServer(app)\n\n        app.get('/playground', graphqlPlayground({ endpoint: '/graphql', codeTheme: 'light' }))\n\n        await apolloServer.start()\n        apolloServer.applyMiddleware({ app })\n        server.listen(process.env.PORT || 3000, () =\u003e console.log(`Apollo server running on ${server.address().port}`))\n      })()\n    ```\n\n    - ##### Example Usage Using ES6\n\n    ```javascript\n      import http from 'http'\n      import { ApolloServer } from 'apollo-server-express'\n      import { applyMiddleware } from 'graphql-middleware'\n      import { makeExecutableSchema } from '@graphql-tools/schema'\n      import playground from 'graphql-playground-middleware-express'\n      import express from 'express'\n      // import module like this\n      import { gtl } from 'gtl-node'\n\n      // change with your graphql schema location folder\n      const typeDefs = gtl({ fileName: 'schema.graphql' }) \n      const { resolvers } = require('./graphql/resolvers')\n      const graphqlPlayground = playground.default\n\n      (async function () {\n        const apolloServer = new ApolloServer({\n          schema: applyMiddleware(makeExecutableSchema({ typeDefs, resolvers }))\n        })\n\n        const app = express()\n        const server = http.createServer(app)\n\n        app.get('/playground', graphqlPlayground({ endpoint: '/graphql', codeTheme: 'light' }))\n\n        await apolloServer.start()\n        apolloServer.applyMiddleware({ app })\n        server.listen(process.env.PORT || 3000, () =\u003e console.log(`Apollo server running on ${server.address().port}`))\n      })()\n    ```\n\n### Testing\n\n- Testing Via Local\n\n  ```sh\n  npm test or make test\n  ```\n\n- Testing Via Local And Build\n\n  ```sh\n  make build\n  ```\n\n- Testing Via Docker\n\n  ```sh\n  docker build -t gtl-node or make dkb tag=gtl-node\n  ```\n\n### Bugs\n\nFor information on bugs related to package libraries, please visit [here](https://github.com/restuwahyu13/graphql-typedefs-loader/issues)\n\n### Contributing\n\nWant to make **Graphql Typedefs Loader** more perfect ? Let's contribute and follow the [contribution guide.](https://github.com/restuwahyu13/graphql-typedefs-loader/blob/main/CONTRIBUTING.md)\n\n### License\n\n- [MIT License](https://github.com/restuwahyu13/graphql-typedefs-loader/blob/main/LICENSE.md)\n\n\u003cp align=\"right\" style=\"padding: 5px; border-radius: 100%; background-color: red; font-size: 2rem;\"\u003e\n  \u003cb\u003e\u003ca href=\"#graphql-typedefs-loader\"\u003eBACK TO TOP\u003c/a\u003e\u003c/b\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frestuwahyu13%2Fgraphql-typedefs-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frestuwahyu13%2Fgraphql-typedefs-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frestuwahyu13%2Fgraphql-typedefs-loader/lists"}