acro5piano / graphql-rest-proxy

Turn your REST API into GraphQL - A Proxy Server that pipes request from GraphQL to REST with GraphQL DSL, performant nested children, mutations, input types, and more.

Home Page:https://www.npmjs.com/package/graphql-rest-proxy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do I have to install apollo-boost in client to make requests?

wobsoriano opened this issue · comments

Hi. This is a very interesting package. I have a question though..

In your example

fetch('http://localhost:5252/graphql', {
  method: 'patch',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    query: gql`
      mutation UpdateUser($id: Int!, $user: UserInput!) {
        updateUser(id: $id, user: $user) {
          id
          name
        }
      }
    `,
    variables: {
      id: 1,
      user: {
        name: 'acro5piano',
      },
    },
  }),
})

Does the gql there means I have to install apollo-boost in client? Thank you very much!

Hi @sorxrob, thank you for your interest in this repository.

The simple answer is no, you don't need apollo-boost or any other client library.
This example shows that you "can" use your prefferd library to make requests. Actually apollo-boost (technically graphql-tag) just compiles gql template to plain string, so you can make your request with plain string too.

Closing due to no activity. Feel free to reopen it.