Giter Site home page Giter Site logo

basemax / typescript-graphql-crud-example Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 299 KB

A example repository to show how you can create your first GraphQL Restful with TS and not JS.

License: MIT License

JavaScript 23.95% TypeScript 76.05%
graphql ts typescript js javascript nodejs graphql-server graphql-client graphql-api graphql-schema

typescript-graphql-crud-example's Introduction

Typescript GraphQL CRUD Example

A example repository to show how you can create your first GraphQL Restful with TS and not JS.

Getting start

yarn install
yarn start

And open http://localhost:4000/graphql

Create another new project

npx create-graphql-express my-api
cd my-api
npm install
npm run dev

Read more: https://github.com/rafaelnsantos/create-graphql-api

Examples

Insert/Create

mutation { 
 createMovie(
  options: {
    title: "bob3", minutes: 10
  }) {
    id
    title
    minutes
  }
}

Update

mutation {
  updateMovie(id: 30
  input: {
    title: "New bob"
  })
}

Select

{
  movies {
    id
    title
    minutes
  }
}

Delete

mutation {
  deleteMovie(id: 3)
}

References

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

I fixed some minor changes to works with the latest version of graphql-api.

© Copyright 2021, Max Base

typescript-graphql-crud-example's People

Contributors

basemax avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.