{"id":16859159,"url":"https://github.com/jdmedlock/graphql-server","last_synced_at":"2025-03-18T14:09:08.276Z","repository":{"id":54936837,"uuid":"314395730","full_name":"jdmedlock/graphql-server","owner":"jdmedlock","description":"A demonstration server for GraphQL experiments ","archived":false,"fork":false,"pushed_at":"2021-01-22T22:33:13.000Z","size":604,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T18:48:09.109Z","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdmedlock.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-11-19T23:35:50.000Z","updated_at":"2021-01-22T22:33:15.000Z","dependencies_parsed_at":"2022-08-14T07:00:58.347Z","dependency_job_id":null,"html_url":"https://github.com/jdmedlock/graphql-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdmedlock%2Fgraphql-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdmedlock%2Fgraphql-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdmedlock%2Fgraphql-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdmedlock%2Fgraphql-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdmedlock","download_url":"https://codeload.github.com/jdmedlock/graphql-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244236080,"owners_count":20420759,"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-10-13T14:16:22.430Z","updated_at":"2025-03-18T14:09:08.249Z","avatar_url":"https://github.com/jdmedlock.png","language":"TypeScript","readme":"# graphql-server\n\nA demonstration server for GraphQL experiments\n\n## Table of Contents\n\n* [Overview](#overview)\n* [Installation \u0026 setup](#installation-setup)\n\n## Overview\n\nThis project is a demonstration server for GraphQL experiments and is based on \nthis\n[article](https://dev.to/wonder2210/graphql-typescript-postgresql-api-271g) \u0026 \n[repo](https://github.com/Wonder2210/graphql-typescript-pg-server).\n\nIt's purpose is to provide a place to test GraphQL techniques as well as the\nsupporting technolgies and libraries like Data Loader \u0026 Objection.\n\n![Architecture Diagram](https://github.com/jdmedlock/graphql-server/blob/main/docs/graphql_server_architecture.png)\n\n## Installation \u0026 setup \n\nTo install:\n\n```\ngit clone https://github.com/jdmedlock/graphql-server\ncd graphql-server\nnpm install\n```\n\n### Database setup\n\nBefore continuing you'll need to install and configure a local PostgreSQL \ninstance and create two databases - `post` and `post-test`. \n\nYou will also need to\nto create and authorize two user accounts in PostgreSQL as owners of theses databases\ndatabases. The default credentials can be found in \n[/src/database/config.ts](https://github.com/jdmedlock/graphql-server/blob/main/src/database/config.ts).\n\nNow you are ready to initialize the Knex migrations \u0026 load the test data:\n\n1. Generate the first Knex migration:\n```\nnpx knex --knexfile ./src/database/knexfile.ts migrate:make -x ts initial\n```\n\n2. Start the server:\n```\nnpm run dev\n```\n\n3. Prepare the DB:\n\n| Environment | Command | Description |\n|:------------|:--------|:------------|\n| Testing     | `npm run test:migrate:up` | Run the Knex migration |\n| Testing     | `npm run test:seed-db` | Load test data into `post-test` DB |\n| Production  | `npm run migrate:up` | Run the Knex migration |\n| Production  | `npm run seed-db` | Load test data into `post` DB |\n\n4. Generate types:\n```\nnpm run generate:types\n```\n\n### Starting the Server\n\nThere are two ways to start the server:\n\n1. As mentioned above, issue the `npm run dev` command from the terminal to\nstart the server. This assumes that you have a PostgreSQL server started, \nlistening on port 5432, and data loaded into the test \u0026 production tables. \n\n2. The second option is to issue the `npm run start-docker` command from the\nterminal to start both a PostgreSQL server and the GraphQL server in a Docker\ncontainer. \n\nRegardless of which of these methods you choose the way you connect to this\nserver remains the same.\n### Insomnia setup\n\nAt this point you are ready to fire up the [Insomnia client](https://insomnia.rest/)\nso you can begin testing GraphQL queries. \n\nYou'll be sending your queries to `http://localhost:3000/graphql` via POST \nrequests containing your GraphQL queries.\n\nA workspace has been pre-configured and saved in the root of this repo, \n[Insomnia_workspace.json](https://github.com/jdmedlock/graphql-server/blob/main/Insomnia_workspace.json). You may import this workspace into Insomnia to save yourself a bit of \ndata entry.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdmedlock%2Fgraphql-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdmedlock%2Fgraphql-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdmedlock%2Fgraphql-server/lists"}