{"id":27153448,"url":"https://github.com/tankengine-ish/graphql_api","last_synced_at":"2025-07-14T08:06:22.903Z","repository":{"id":224425129,"uuid":"762810147","full_name":"TankEngine-ish/GraphQL_API","owner":"TankEngine-ish","description":"A Node.js GraphQL API + Apollo [personal project]","archived":false,"fork":false,"pushed_at":"2024-02-27T20:01:21.000Z","size":338,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-02-27T22:28:56.140Z","etag":null,"topics":["apollo-server","graphiql","graphql-tools"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TankEngine-ish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-24T18:50:19.000Z","updated_at":"2024-02-27T21:40:14.000Z","dependencies_parsed_at":"2024-02-25T22:28:30.828Z","dependency_job_id":"5f849c16-fea3-4204-8a37-5259969e793a","html_url":"https://github.com/TankEngine-ish/GraphQL_API","commit_stats":null,"previous_names":["tankengine-ish/graphql_api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TankEngine-ish%2FGraphQL_API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TankEngine-ish%2FGraphQL_API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TankEngine-ish%2FGraphQL_API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TankEngine-ish%2FGraphQL_API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TankEngine-ish","download_url":"https://codeload.github.com/TankEngine-ish/GraphQL_API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247878013,"owners_count":21011158,"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":["apollo-server","graphiql","graphql-tools"],"created_at":"2025-04-08T16:17:00.540Z","updated_at":"2025-04-08T16:17:01.071Z","avatar_url":"https://github.com/TankEngine-ish.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQL_API\n\n\n## Overview\n\nThis is a simple GraphQL API built with Apollo Server and Express.js. It provides functionality for querying and mutating data related to products and orders.\n\n## Setup\n\nThe server is set up in server.js using Apollo Server and Express.js. The GraphQL schema and resolvers are loaded from the *.graphql and *.resolvers.js files respectively. The server listens on port 3000 and exposes the GraphQL API at the /graphql endpoint.\n\n## Schema\n\nThe schema is defined in the *.graphql files. It includes the following types:\n\n- `Product`: Represents a product with an id, description, price, and reviews.\n- `Review`: Represents a review with a rating and comment.\n- `Order`: Represents an order with a date, subtotal, and items.\n- `OrderItem`: Represents an order item with a product and quantity.\n\nThe schema also includes the following queries and mutations:\n\n* Query:\n\n- `products`: Returns all products.\n- `productsByPrice(min: Float!, max: Float!)`: Returns products within a price range.\n- `product(id: ID!)`: Returns a product by ID.\n- `orders`: Returns all orders.\n\n* Mutation:\n\n- `addNewProduct(id: ID!, description: String!, price: Float!)`: Adds a new product.\n- `addNewProductReview(id: ID!, rating: Int!, comment: String)`: Adds a new product review.\n\n## Resolvers\n\nThe resolvers are defined in the *.resolvers.js files. They provide the logic for fetching and mutating data based on the queries and mutations defined in the schema.\n\n- `products.resolvers.js`: Contains resolvers for the products, productsByPrice, product, addNewProduct, and addNewProductReview queries and mutations.\n- `orders.resolvers.js`: Contains the resolver for the orders query.\n\n## Data\n\nThe data for products and orders is stored in memory in the products.model.js and orders.model.js files respectively. The data includes a list of products and a list of orders, each with their respective properties as defined in the schema. The models also include functions for fetching and mutating the data.\n\n## Notes\n\nBefore adding Apollo Server package I tested the queries inside graphiQL\n\n![alt text](\u003cassets/Screenshot from 2024-02-27 17-42-35.png\u003e)\n\n\nOnce you get Apollo you can test your queries, mutations and much more inside this cool front-end itnerface.\n\n![alt text](\u003cassets/Screenshot from 2024-02-27 21-32-53.png\u003e)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftankengine-ish%2Fgraphql_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftankengine-ish%2Fgraphql_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftankengine-ish%2Fgraphql_api/lists"}