GithubHelp home page GithubHelp logo

graphql-demo's Introduction

GraphQL one kind of language you use query API born, 2018 has come, GraphQL applications may also not be far away. One of the biggest features of the development of the front-end is that it changes quickly, and sometimes it has to deal with changes in various demand scenarios, and has to develop many versions or modifications to the interface. Various businesses rely on a strong underlying data platform to grow rapidly, and how to efficiently provide data support for various services is a concern for everyone. Moreover, the front-end solution is to componentize the view. Each line of business can be either the user of the component or the producer of the component. If the common content can be extracted and provided to each business party for repeated use, it will be able to Save valuable development time and development manpower. Then the problem comes. The front-end implements cross-business reuse through components. How does the back-end interface improve development efficiency accordingly? GraphQL, it is a new way to deal with complex scenes.

Official explanation:

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

Here are some of the benefits of GraphQL:

  • Ask for what you need, get exactly that

  • Get many resources in a single request

  • Describe what’s possible with a type system

  • Move faster with powerful developer tools

  • API evolution does not require a version

This article will be used with koa to implement a GraphQL query example, gradually from the simple kao service to mongodb data insertion query to the use of GraphQL, Let everyone quickly see:

  • Build a koa to build a backstage project
  • Simple routing method
  • Simple operation mongodb with mongoose
  • Getting started with GraphQL

The project is shown below

1、Build GraphQL tool query interface。

2、The front end uses jq to send ajax usage

install

git clone https://github.com/naihe138/GraphQL-demo.git

npm install 

node start

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.