简体   繁体   中英

Should GraphQL be used in backend or frontend?

Does using GraphQL directly on React cause security threats such as server information and browser manipulation? Is this road safe?

Or should we call the GraphQL data from the backend? But if this happens, we will be using the Restful API again to use GraphQL this time.

In what situations and where should GraphQL be used?

First of all, graphQL is a communication protocol. That means you can transfer data between a client and a server. The client can send an HTTP request (mostly the foundation of graphQL) with a query and optional variables to a server. The server resolves and processes the query and answers with some data.

To answer your question : If you use graphQL, you can use it for both the client and server side. Make sure that you build authentication/authorization logic for sensitive data.

For more information checkout this blog post:https://blog.postman.com/what-is-a-graphql-api-how-does-it-work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM