graphql-rest-proxy icon indicating copy to clipboard operation
graphql-rest-proxy copied to clipboard

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

Open wobsoriano opened this issue 4 years ago • 1 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!

wobsoriano avatar Aug 26 '19 03:08 wobsoriano

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.

acro5piano avatar Aug 26 '19 08:08 acro5piano

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

acro5piano avatar Nov 24 '22 03:11 acro5piano