absinthe-graphql / absinthe-socket

Core JavaScript support for Absinthe WS-based operations
MIT License
149 stars 75 forks source link

Feature request, complete example documentation. #27

Closed JonRowe closed 6 years ago

JonRowe commented 6 years ago

Hi, I'm new to this project and struggling to understand from the individual function docs how to use this. Is there a chance someone with better knowledge could complete the Readme with an example that actually connects to an absinthe server, sends a query (preferably a subscription) and does something with the response?

JonRowe commented 6 years ago

Additionally docs on how to construct a GqlRequest from a prefab string (I have a query coming from Elm I need to connect up to absinthe, so the backtick `` style here doesn't work, using the string as is seems to cause an error.

alukito commented 6 years ago

Hi, I'm also new, but I find these examples to be working.

  1. Setup the apollo client using this apollo guide
  2. Change the ApolloClient implementation using @absinthe-socket/socket-apollo-link using the readme. Note that since we're changing the apollo link to use for the client, we could not use apollo-boost but we need the individual libraries like apollo-client and apollo-cache-inmemory

This is using React, so maybe you need to adjust accordingly when using Elm. Hope that helps.

JonRowe commented 6 years ago

@alukito Thanks but I'm not using Apollo, so I'm still looking for a complete example for the base socket implementation.

JonRowe commented 6 years ago

Closing in preference to #28