{"id":20008731,"url":"https://github.com/easygraphql/easygraphql-firebase","last_synced_at":"2025-10-07T03:45:55.719Z","repository":{"id":57218876,"uuid":"161561820","full_name":"EasyGraphQL/easygraphql-firebase","owner":"EasyGraphQL","description":"Starter file for GraphQL connected with firebase just from a schema.","archived":false,"fork":false,"pushed_at":"2019-10-16T13:54:57.000Z","size":83,"stargazers_count":99,"open_issues_count":5,"forks_count":3,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-06-06T14:41:02.788Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/EasyGraphQL.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":"2018-12-13T00:28:03.000Z","updated_at":"2025-04-22T22:31:01.000Z","dependencies_parsed_at":"2022-08-29T02:11:45.195Z","dependency_job_id":null,"html_url":"https://github.com/EasyGraphQL/easygraphql-firebase","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/EasyGraphQL/easygraphql-firebase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EasyGraphQL%2Feasygraphql-firebase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EasyGraphQL%2Feasygraphql-firebase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EasyGraphQL%2Feasygraphql-firebase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EasyGraphQL%2Feasygraphql-firebase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EasyGraphQL","download_url":"https://codeload.github.com/EasyGraphQL/easygraphql-firebase/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EasyGraphQL%2Feasygraphql-firebase/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268594422,"owners_count":24275737,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-13T07:11:51.728Z","updated_at":"2025-10-07T03:45:50.673Z","avatar_url":"https://github.com/EasyGraphQL.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/EasyGraphQL/easygraphql-now/master/logo.png\" alt=\"easygraphql-firebase \" width=\"350\"\u003e\n  \u003cbr\u003e\n    easygraphql-firebase \n  \u003cbr\u003e\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n`easygraphql-firebase` is global package that will create a GraphQL server connected\nto your Firebase real-time database just using a GraphQL schema.\n\n## Installation\n```bash\n$ npm install easygraphql-firebase -g\n```\n\n## Usage\nTo get started with your GraphQL-Firebase server you need to have:\n\n+ GraphQL schema.\n+ Firebase API key.\n+ Firebase database url.\n\nCreate a GraphQL schema file.\n```graphql\ntype Student {\n  key: ID!\n  age: Int!\n  name: String!\n}\n\ntype School {\n  key: ID!\n  location: String!\n  students: Int!\n  name: String!\n  student: Student!\n}\n\ninput StudentInput {\n  age: Int!\n  name: String!\n}\n\ninput SchoolInput {\n  location: String!\n  students: Int!\n  name: String!\n  phone: String!\n  student: StudentInput!\n}\n\ntype Query {\n  getStudentByUsername(name: String!): Student!\n  getStudents: [Student!]!\n  getSchool(name: String!): School!\n  getSchools: [School!]!\n}\n\ntype Mutation {\n  createStudent(input: StudentInput!): Student!\n  createSchool(input: SchoolInput!): School!\n}\n```\n\n#### Run on your terminal\n\n```bash\n$ easygraphql-firebase\n```\nby default it is going to run the server automatically.\n\nYou can set flags to prevent running it automatically, set apiKey, set databaseUrl and also pass the schema name.\n\n```bash\n$ easygraphql-firebase schema.gql --apiKey=\u003cYOUR_API_KEY\u003e --databaseUrl=\u003cYOUR_DATABASE_URL\u003e --start=false\n```\n\nand select the GraphQL schema you want to use; also, it will ask for some env variables,\nyou can press enter and add them later.\n\n`easygraphql-firebase` will start creating the whole project, and also it will add to the new schema\nsome new queries, like\n```graphql\ntype Query {\n  ....\n  getUserByKey(key: ID!): User\n  getSchoolByKey(key: ID!): School\n}\n```\n\nalso, there is going to be a folder to make tests, it is using [`easygraphql-tester`](https://github.com/EasyGraphQL/easygraphql-tester)\nso, if you want to test your queries and mutations, visit the folder `test` and add on cases your own tests, add a name to identify them.\n\n```js\nconst cases = [\n  {\n    name: 'Should get school by key',\n    query: `\n      {\n        getSchoolByKey(key: \"-LTYEa4geFv52c5rzpCS\") {\n          name\n        }\n      }\n    `,\n    expected: true\n  }\n]\n```\n\n### Result\n```shell\nValidate query\n    ✓ Should validate the query: Should get school by key\n```\n\n## Collections\n\nThe collections that are going to be query are going to be the name of the expected type in lowercase with an `s` at the end.\n\nE.g\nIf you have this query `getStudentByUsername(name: String!): Student!` the resolver is going to search on Firebase\nfor a collection called `students`\n\n## Run it\nTo run your project visit the generated folder and run:\n\n```bash\n$ npm run start\n```\n\n## Recommendations\nThis a **beta** version, so the recommendations are:\n\n+ Just set one argument to the queries.\n+ Add nested fields from the input, if you want to add custom logic, edit the resolvers.\n+ Test your queries / mutations.\n+ If you are having a lot of records, and you are making a query that returns an array\n  add a limit to it!\n\n## Deploying with Now ▲\nTo deploy with now, be sure to have it installed and config on your computer.\n\nTo use it, just pass the flag `--now` to the command on the terminal:\n\n```bash\n$ easygraphql-firebase --now\n```\n\n# License\n### The MIT License\n\nCopyright (c) 2018 EasyGraphQL\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasygraphql%2Feasygraphql-firebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feasygraphql%2Feasygraphql-firebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasygraphql%2Feasygraphql-firebase/lists"}