{"id":13499660,"url":"https://github.com/DxCx/webpack-graphql-server","last_synced_at":"2025-03-29T05:31:57.554Z","repository":{"id":57150362,"uuid":"66308479","full_name":"DxCx/webpack-graphql-server","owner":"DxCx","description":"Starter kit for apollo server using webpack and typescript","archived":false,"fork":false,"pushed_at":"2018-12-14T10:29:17.000Z","size":246,"stargazers_count":159,"open_issues_count":5,"forks_count":31,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-28T22:55:48.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/DxCx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-22T21:09:52.000Z","updated_at":"2023-12-20T16:55:52.000Z","dependencies_parsed_at":"2022-09-03T18:40:07.571Z","dependency_job_id":null,"html_url":"https://github.com/DxCx/webpack-graphql-server","commit_stats":null,"previous_names":["dxcx/webpack-apollo-server"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DxCx%2Fwebpack-graphql-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DxCx%2Fwebpack-graphql-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DxCx%2Fwebpack-graphql-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DxCx%2Fwebpack-graphql-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DxCx","download_url":"https://codeload.github.com/DxCx/webpack-graphql-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221949884,"owners_count":16906484,"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":[],"created_at":"2024-07-31T22:00:37.775Z","updated_at":"2024-10-31T18:30:54.359Z","avatar_url":"https://github.com/DxCx.png","language":"TypeScript","readme":"# webpack-graphql-server\n\n[![npm version](https://badge.fury.io/js/webpack-graphql-server.svg)](https://badge.fury.io/js/webpack-graphql-server) [![Build Status](https://travis-ci.org/DxCx/webpack-graphql-server.svg?branch=master)](https://travis-ci.org/DxCx/webpack-graphql-server) [![Coverage Status](https://coveralls.io/repos/github/DxCx/webpack-graphql-server/badge.svg?branch=master)](https://coveralls.io/github/DxCx/webpack-graphql-server?branch=master)\n\nStarter kit for apollo graphql server using webpack and typescript\n\nWhat does it include:\n----\n    1. exported schema as example for GraphQL Schema\n    2. Working Apollo Server (webpack + tslint + tsloader)\n    3. Typescript 2.4.2 =\u003e ES6\n    4. Dockerfile to make the graphql-server a container.\n    5. unit testing (jest) + coverage report (jest --coverage).\n    6. working with graphql-tools\n    7. standard-version for auto SemVer.\n\nNotes\n----\nPlease note that you will need to rename the library name in some files:\n\n    1. package.json (ofcourse ;))\n\nUseful commands:\n----\n    npm run build       - build the library files (Required for start:watch)\n    npm run build:watch - build the library files in watchmode (Useful for development)\n    npm start           - Start the server\n    npm run start:watch - Start the server in watchmode (Useful for development)\n    npm test            - run tests once\n    npm run test:watch  - run tests in watchmode (Useful for development)\n    npm run test:growl  - run tests in watchmode with growl notification (even more useful for development)\n    npm run upver       - runs standard-version to update the server version.\n\nHow to run it:\n----\n```bash\n    npm start\n```\n\nFiles explained:\n----\n    1. src                         - directory is used for typescript code that is part of the project\n        1a. main.ts                - Main server file. (Starting Apollo server)\n        1b. main.spec.ts           - Tests file for main\n        1c. schema                 - Module used to build schema\n            - index.ts             - simple logic to merge all modules into a schema using graphql-tools\n            - modules/             - directory for modules to be used with graphql-tools\n        1c. schema.spec.ts         - Basic test for schema.\n        1c. main.test.ts           - Main for tests runner.\n    3. package.json                - file is used to describe the library\n    4. tsconfig.json               - configuration file for the library compilation\n    6. tslint.json                 - configuration file for the linter\n    7. typings.json                - typings needed for the server\n    8. webpack.config.js           - configuration file of the compilation automation process for the library\n    9. webpack.config.test.js      - configuration file of the compilation when testing\n    10. Dockerfile                 - Dockerfile used to describe how to make a container out of apollo server\n    11. mocha-webpack.opts         - Options file for mocha-webpack\n\nOutput files explained:\n----\n    1. node_modules - directory npm creates with all the dependencies of the module (result of npm install)\n    2. dist         - directory contains the compiled server (javascript)\n    3. html-report  - output of npm test, code coverage html report.\n\nThe Person type - dynamic/parametrized query and drill down:\n----\nThe person type was added to demonstrate a database like access, parametrized queries, resolvers and drill down.\nThe data is currently hard coded but simulates a storage. Each person has an id, name and sex. It also has a dynamic\nfield called matches. For demonstration purposes, this field will retrieve all members of the other sex by using a\nresolver.\n\nSince this is a computed field the query can be infinitely nested, for example, try in the graphiql editor this query:\n\n    {\n       getPerson(id: \"1\") {\n         id,\n         name\n         sex\n         matches {\n           id\n           name\n           sex\n           matches {\n             id\n             name\n             sex\n             matches {\n               id\n               name\n               sex\n             }\n           }\n         }\n       }\n     }\n\nIt will return a nested, alternating male/femal results.\n\nTo list all persons, use the `persons` query:\n\n    {\n      persons {\n        id\n        name\n      }\n    }\n\nThere is also an example of a mutation - `addPerson(name: String, sex: String)`, to use it:\n\n    mutation {\n        addPerson(name: \"kuku\", sex: \"male\"){\n            id\n            name\n        }\n    }\n\nNote that the query generates a random id and that the added persons are transient,\ni.e. not persisted and will be gone once you shut down the server.\n\nSample clients for this server:\n----\n* [ionic2](https://github.com/philipbrack/ionic2-apollo-simple)\n","funding_links":[],"categories":["Examples","TypeScript"],"sub_categories":["TypeScript Examples"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDxCx%2Fwebpack-graphql-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDxCx%2Fwebpack-graphql-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDxCx%2Fwebpack-graphql-server/lists"}