Idea: Add helpers to intersect a query on the server to get relevant data
See original GitHub issuetype CommentCreateSubscriptionInput {
clientMutationId: ID!
storyId: ID!
}
subscription A($input_1: CommentCreateSubscriptionInput) {
123Comment: commentCreateSubscription(input: $input_1) {
commentEdge {
cursor
node
}
}
}
// When relay prints the query they rename the variables to input_1 input_2 etc. So we can't know for sure what pairs if we don't parse the query.
send(query, variables = { input_1: { clientMutationId: '1', storyId: '123' }});
// server
getVariablesForQuery(query, schema, {
commentCreateSubscription: (arguments) => { // this will be called for the 123Comment field
pubsub.subscribe(`comment_create_${arguments.input.storyId}`, sendPayloadToClient);
}
});
What if we can intersect this query without executing it and get all variables paired with a subscription. Then we can move the subscription creation from the resolve handlers on the server and still get rid of the separate topic that I send along the query in the todo app (create the topic server side instead of letting the client decide).
Does this make sense? I don’t know…
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
SQL intersect use in SQL Server
The SQL intersect operator allows us to get common values between two tables or views. The following graphic shows what the intersect does....
Read more >Query consoles | IntelliJ IDEA Documentation - JetBrains
Click a data source, press Alt+Insert , and select Query Console. Click a data source, press Ctrl+Shift+F10 , and select New Query Console....
Read more >SQL Intermediate: PostgreSQL, Subqueries, and more!
Learn how to work with SQL in more detail including setting up tables in PostgreSQL, views, subqueries and more.
Read more >1.3 Bags, Queues, and Stacks - Algorithms, 4th Edition
Create a data type that represents a set of integers (no duplicates) between 0 and N-1. Support add(i), exists(i), remove(i), size(), intersect, ...
Read more >Combine multiple tables with UNION / UNION ALL in
If you want to combine several tables, you have to ask yourself ... as SQL Server, in the processing of the data (ETL)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yep, I missed.
Anyway may be you didn’t see talks about subscriptions, and can catch some good ideas: Standalone talk of Laney Kuenzel about subcriptions https://www.youtube.com/watch?v=mmke4w4gc6c Talk with Lee on React Europe https://www.youtube.com/watch?v=ViXL0YQnioU
And of course, let ask @leebyron and @laneyk give some advice how to implement creation of subscriptions.
👍