{"id":13499234,"url":"https://github.com/graphitejs/server","last_synced_at":"2025-04-04T20:09:36.561Z","repository":{"id":18979779,"uuid":"85720242","full_name":"graphitejs/server","owner":"graphitejs","description":"Framework NodeJS for GraphQl","archived":false,"fork":false,"pushed_at":"2025-03-24T19:07:19.000Z","size":8739,"stargazers_count":121,"open_issues_count":16,"forks_count":56,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-28T19:07:01.620Z","etag":null,"topics":["framework","graphql","graphql-server","javascript","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/graphitejs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["wzalazar"]}},"created_at":"2017-03-21T15:39:19.000Z","updated_at":"2025-03-05T10:37:52.000Z","dependencies_parsed_at":"2023-01-11T20:30:26.470Z","dependency_job_id":"8eb9bd84-6172-49e9-b258-7fdf388f5e06","html_url":"https://github.com/graphitejs/server","commit_stats":{"total_commits":842,"total_committers":6,"mean_commits":"140.33333333333334","dds":"0.49406175771971494","last_synced_commit":"b50a32d053f0232b34b68930ff706b865e24ae97"},"previous_names":["graphitejs/graphitejs"],"tags_count":122,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphitejs%2Fserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphitejs%2Fserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphitejs%2Fserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphitejs%2Fserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphitejs","download_url":"https://codeload.github.com/graphitejs/server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242678,"owners_count":20907134,"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":["framework","graphql","graphql-server","javascript","nodejs"],"created_at":"2024-07-31T22:00:31.158Z","updated_at":"2025-04-04T20:09:36.541Z","avatar_url":"https://github.com/graphitejs.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"GraphiteJS\" src=\"https://raw.githubusercontent.com/graphitejs/server/HEAD/images/graphite.png\" width=\"334\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    Framework NodeJS for GraphQl\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"http://graphitejs.com\"\u003e\u003cimg alt=\"graphitejs\" src=\"https://img.shields.io/badge/GraphiteJS-Beta-yellow.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://travis-ci.org/graphitejs/server\"\u003e\u003cimg alt=\"TravisCI Status\" src=\"https://travis-ci.org/graphitejs/server.svg?branch=master\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/graphitejs/server\"\u003e\u003cimg alt=\"Codecov Status\" src=\"https://codecov.io/gh/graphitejs/server/branch/master/graph/badge.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"#badge\"\u003e\n      \u003cimg alt=\"semantic-release\" src=\"https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@graphite/server\"\u003e\n      \u003cimg alt=\"npm latest version\" src=\"https://img.shields.io/npm/v/@graphite/server/latest.svg\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\nGraphiteJS is a NODE.JS Framework for building GraphQL schemas/types fast, easily and with scalability. \n\n- **Easy to use:** GraphiteJS make easy GraphQL in NodeJS without effort.\n- **Any Front:** GraphiteJS support any front library.\n- **Data agnostic:** GraphiteJS supports any kind of data source.\n\n---\n## Guide\n\n- [Install](#install)\n- [How to use](#how-to-use)\n    - [Types](#types)\n    - [Queries](#queries)\n    - [Mutations](#mutations)\n    - [Subscriptions](#subscriptions)\n    - [Relations](#relations)\n- [Contributing](#contributing)\n- [Team](#team)\n\n---\n\n## Install\n\n```bash\n\nnpm i @graphite/server --save\n\nyarn add @graphite/server\n\n```\n\non your index file:\n\n```javascript\n\nimport { Graphite } from '@graphite/server'\n\nmain = async () =\u003e {\n  const graphite = await Graphite()\n}\n\nmain()\n\n```\n\nand that's all, you have running the graphqli tool on the port [4000](http://localhost:4000/graphqle) by default.\n\n## How to use\n\nAfter install `@graphite/server` you have to create your first model. We recommend creating a folder called models and follow the pattern matching the filename with the Type name.\n\n#### Types\n\n```javascript\n\nimport { GraphQL } from '@graphite/server'\n\nexport const Developer = GraphQL('Developer')({\n   // the value always have to be an array first arg is the type, the second arg is an optional comment\n  name: ['String!', 'Your name is required'],\n  age: ['Int'],\n  isGreatDeveloper: ['Boolean']\n})\n\n```\n\nSo, now you need to pass this model to the Graphite Server\n\n\non `index.js`\n\n```javascript\n\nimport { Graphite } from '@graphite/server'\nimport { Developer } from './models/Developer'\n\nmain = async () =\u003e {\n  await Graphite({ models: [Developer] })\n}\n\nmain()\n\n```\n\n#### Queries\n\n\n```javascript\n\nimport { GraphQL } from '@graphite/server'\n\nexport const Developer = GraphQL('Developer')({\n  name: ['String!', 'Your name is required'],\n  age: ['Int'],\n  isGreatDeveloper: ['Boolean'],\n\n  Query: {\n    'developer: Developer': () =\u003e ({ name: 'Your name' }),\n    'developers: [Developer]': () =\u003e ([{ name: 'Your name' }]),\n  }\n})\n\n```\n\n#### Mutations\n\n\n```javascript\n\nimport { GraphQL } from '@graphite/server'\n\nexport const Developer = GraphQL('Developer')({\n  name: ['String!', 'Your name is required'],\n\n  Mutation: {\n    'createDeveloper(name: String): Developer': (_, { name, }) =\u003e ({ name }),\n    'updateDeveloper(id: ID!, name: String): Developer': (_, { name }) =\u003e ({ name }),\n    'removeDeveloper(id: ID!): Developer': (_, { name }) =\u003e ({ name }),\n  },\n})\n\n```\n\n\n#### Subscriptions\n\n\n```javascript\n\nimport { GraphQL, PubSub } from '@graphite/server'\n\nconst pubsub = new PubSub()\nconst DEVELOPER_ADDED = 'DEVELOPER_ADDED'\n\nexport const Developer = GraphQL('Developer')({\n  name: ['String!', 'Your name is required'],\n\n  Mutation: {\n    'createDeveloper(name: String): Developer': (_, { name, }) =\u003e { \n      pubsub.publish(DEVELOPER_ADDED, { developerAdded: { name } })\n      return { name }\n    },\n  },\n\n  Subscription: {\n    'developerAdded: Developer': {\n      subscribe: () =\u003e pubsub.asyncIterator([DEVELOPER_ADDED]),\n    },\n  },\n})\n\n```\n\n#### Relations\n\n\n```javascript\n\n  // models/Repository.js\n  const Repository = GraphQL('Repository')({\n      name: ['String'],\n      url: ['String'],\n  })\n\n  // models/GithubProfile.js\n  const GithubProfile = GraphQL('GithubProfile')({\n      url: ['String'],\n  })\n\n  // models/Developer.js\n  const Developer = GraphQL('Developer')({\n    name: ['String'],\n\n    'respositories: [Repository]': () =\u003e [{ name: 'GraphiteJS', url: 'https://github.com/graphitejs/graphitejs' }],\n\n    'githubProfile: GithubProfile': () =\u003e ({ url: 'https://github.com/wzalazar' }),\n\n    Query: {\n      'developer: Developer': () =\u003e ({ name: 'Walter Zalazar' }),\n    },\n  })\n\n```\n\nSo, now you need to pass this model to the Graphite Server\n\n\non `index.js`\n\n```javascript\n\nimport { Graphite } from '@graphite/server'\nimport { Developer } from './models/Developer'\nimport { Repository } from './models/Repository'\nimport { GithubProfile } from './models/GithubProfile'\n\nmain = async () =\u003e {\n  await Graphite({ models: [Developer, Repository, GithubProfile] })\n}\n\nmain()\n\n```\n\n## Contributing\n\nPlease see our [contributing.md](./CONTRIBUTING.md)\n\n- Clone this repository.\n- Install dependencies.\n\n```bash\n\nnpm install\n\n```\n\n- Feel free for pull request.\n\n\n## Team\n\n### Creator\n\n[![Walter Zalazar](https://avatars.githubusercontent.com/u/5795257?s=64)](https://github.com/wzalazar) |\n|---|\nWalter Zalazar |\n:octocat: [@wzalazar](https://github.com/wzalazar) |\n:bird: [@wzalazar_](https://twitter.com/wzalazar_) |\n\n### Core members\n\n| [![Walter Zalazar](https://avatars.githubusercontent.com/u/5795257?s=64)](https://github.com/wzalazar)  | [![Jose Casella](https://avatars.githubusercontent.com/u/23145933?s=64)](https://github.com/jl-casella) |\n|---|---|\n| Walter Zalazar | José Luis Casella |\n| :octocat:[@wzalazar](https://github.com/wzalazar) | [@jl-casella](https://github.com/jl-casella) |\n| :bird:[@wzalazar_](https://twitter.com/wzalazar_) | [@jl-casella](https://twitter.com/jl-casella) |\n\n## License\n\n[MIT](https://github.com/babel/babel/blob/master/LICENSE)\n","funding_links":["https://github.com/sponsors/wzalazar"],"categories":["Libraries","JavaScript","Implementations"],"sub_categories":["JavaScript Libraries","JavaScript/TypeScript"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphitejs%2Fserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphitejs%2Fserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphitejs%2Fserver/lists"}