question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Idea: Add helpers to intersect a query on the server to get relevant data

See original GitHub issue
type 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:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nodkzcommented, Jun 20, 2016

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.

0reactions
edvineriksoncommented, Aug 25, 2016

👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found