easco / absinthe_apollo_sockets Goto Github PK
View Code? Open in Web Editor NEWUse the Apollo Websocket protocol to drive Absinthe GraphQL functionality
License: MIT License
Use the Apollo Websocket protocol to drive Absinthe GraphQL functionality
License: MIT License
The default message handler currently doesn't handle stop messages from Apollo so it will leak processes (ApolloSocket.DataBroker) and memory
In the working draft spec, there are restrictions on when and if the "data", "errors" or "extensions" items should be included. OperationMessage.new_data
should be refactored a bit not to set "data":null
if there was no data item received, should handle the "extensions" item, etc. Nitpicking, but some clients might depend on these things.
Hi Scott. Thanks for the library.
Do you have an example of how to integrate this with Phoenix?
I'm looking at: https://github.com/easco/absinthe_apollo_sockets/blob/master/examples/apollo_cowboy/lib/apollo_cowboy.ex#L11-L17
Not sure how to incorporate this while still keeping the Phoenix Cowboy2Handler.
Ideally, I'd like to keep absinthe_phoenix
around for GraphiQL, perhaps putting Apollo Sockets at a different path.
The two current examples both implement the same Absinthe.Subscription.PubSub behavior, except for their names, and node names, in ApolloCowboyExample.Absinthe.PubSub and PhoenixSample.Absinthe.PubSub.
This code could be moved inside the library as a macro, to eliminate redundancy. Then applications would just specify the new module (I suggest "ApolloSocket.Absinthe.PubSub") as a parameter to Absinthe.Subscription in their start up.
The Absinthe.Phoenix.Endpoint
module in the Absinthe GitHub repository can be used as a guide on how this can be set up.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.