paint-brush
Create a GraphQL — Firebase server just with a schema. 🚀by@estrada9166
5,782 reads
5,782 reads

Create a GraphQL — Firebase server just with a schema. 🚀

by Alejandro EstradaDecember 13th, 2018
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Now you can create a GraphQL server, connected to your Firebase 🔥 database just running a command on your terminal.

Company Mentioned

Mention Thumbnail
featured image - Create a GraphQL — Firebase server just with a schema. 🚀
Alejandro Estrada HackerNoon profile picture

Now you can create a GraphQL server, connected to your Firebase 🔥 database just running a command on your terminal.

How to use it:

  1. Install easygraphql-firebase:

$ npm install easygraphql-firebase -g

2. Create a GraphQL schema file with the model you want to have:





type Student {key: ID!age: Int!name: String!}







type School {key: ID!location: String!students: Int!name: String!student: Student!}




input StudentInput {age: Int!name: String!}







input SchoolInput {location: String!students: Int!name: String!phone: String!student: StudentInput!}






type Query {getStudentByUsername(name: String!): Student!getStudents: [Student!]!getSchool(name: String!): School!getSchools: [School!]!}




type Mutation {createStudent(input: StudentInput!): Student!createSchool(input: SchoolInput!): School!}

3. Run on your terminal:

$ easygraphql-firebase

And that’s it, easygraphql-firebase will do everything for you, it will create the server, resolvers, test files and more… check the video to see the result

https://www.youtube.com/watch?v=e0IEEZ1kHDY

If you want to deploy with now, be sure to have it installed and just pass the flag --now

$ easygraphql-firebase --now

If you like this package don’t forget to give a ⭐️ on GitHub.

Repo: https://github.com/EasyGraphQL/easygraphql-firebase

npm: https://www.npmjs.com/package/easygraphql-firebase

Website: https://easygraphql.com/