<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="33442" data-post-id="33442">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="manukall" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/manukall/120/20326_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  manukall
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>i never said jsonapi, i said “a json api” as in an api that communicates in json.</p>
<p>i still believe ajax with json might be a good choice for op, as they seem to be learning. read up on best practices about building a rest api and connecting that to a frontend and you pretty much have a step by step guide.</p>
<p>if you want to build the websocket / channels integration, you need to invent a lot yourself. the tools are all there, but best practices not so much, i think.</p>
<p>technically, you are all correct. websockets / channels will outperform ajax. i was looking more at the learning and documentation side.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="33442" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/help-making-a-design-choice-ajax-vs-websocket/5145/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-33442" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="33442"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="33449" data-post-id="33449">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="manukall" data-post="12" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/manukall/48/20326_2.png" class="avatar"> manukall:</div>
<blockquote>
<p>i never said jsonapi, i said “a json api” as in an api that communicates in json.</p>
</blockquote>
</aside>
<p>Ah I see most people reference actual JSON API, sorry for the quick reaction.  ^.^</p>
<p>In that case yeah, a simple JSON interface, or GraphQL (which returns json) would be great.</p>
<aside class="quote no-group" data-username="manukall" data-post="12" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/manukall/48/20326_2.png" class="avatar"> manukall:</div>
<blockquote>
<p>if you want to build the websocket / channels integration, you need to invent a lot yourself. the tools are all there, but best practices not so much, i think.</p>
</blockquote>
</aside>
<p>Hmmm such as?  Take GraphQL over websockets, there are libraries out that simplify that trivially.  Or just make the raw channel calls, which is simple json.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="33449" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/help-making-a-design-choice-ajax-vs-websocket/5145/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-33449" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="33449"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="33453" data-post-id="33453">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Emily" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Emily/120/2422_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Emily
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks for all the input.</p>
<p>If I go down the Websocket route, is there any disadvantage to using the <a href="http://Sockets.io" rel="noopener nofollow ugc">Sockets.io</a> abstraction of Websockets for the VueJS side?  Or am I just adding complexity? (I know nothing about either currently.)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="33453" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/help-making-a-design-choice-ajax-vs-websocket/5145/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-33453" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="33453"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="33455" data-post-id="33455">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="peerreynders" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/120/5826_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  peerreynders
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Emily" data-post="14" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/emily/48/2422_2.png" class="avatar"> Emily:</div>
<blockquote>
<p>is there any disadvantage to using the <a href="http://Sockets.io" rel="noopener nofollow ugc">Sockets.io</a> abstraction of Websockets for the VueJS side?</p>
</blockquote>
</aside>
<p>Technically you would be using a Phoenix channel, which only uses web sockets if they are available, so you would want to stick with the Phoenix API - at least that is my understanding.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="33455" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/help-making-a-design-choice-ajax-vs-websocket/5145/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-33455" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="33455"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="33459" data-post-id="33459">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Emily" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Emily/120/2422_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Emily
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>…On the Phoenix side… but I still needs something on the VueJS side, I believe??</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="33459" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/help-making-a-design-choice-ajax-vs-websocket/5145/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-33459" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="33459"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="33462" data-post-id="33462">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Emily" data-post="14" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/emily/48/2422_2.png" class="avatar"> Emily:</div>
<blockquote>
<p>If I go down the Websocket route, is there any disadvantage to using the <a href="http://Sockets.io" rel="noopener nofollow ugc">Sockets.io</a> abstraction of Websockets for the VueJS side?  Or am I just adding complexity? (I know nothing about either currently.)</p>
</blockquote>
</aside>
<p>I’ve never used nor even heard of <a href="http://Sockets.io" rel="noopener nofollow ugc">Sockets.io</a>, so I could not say.  ^.^<br>
The Phoenix stock javascript is dead simple to use though.  <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<aside class="quote no-group" data-username="Emily" data-post="16" data-topic="5145" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/emily/48/2422_2.png" class="avatar"> Emily:</div>
<blockquote>
<p>…On the Phoenix side… but I still needs something on the VueJS side, I believe??</p>
</blockquote>
</aside>
<p>Just make the calls via any normal way you would in vuejs, you could even sprinkle it around in the components directly (though putting them in another class and wrapping them lets you easily change it in the future, like to GraphQL over phoenix websockets or something).  <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="33462" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/help-making-a-design-choice-ajax-vs-websocket/5145/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-33462" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="33462"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="33464" data-post-id="33464">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="peerreynders" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/120/5826_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  peerreynders
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="17" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>Just make the calls via any normal way you would in vuejs, you could even sprinkle it around in the components directly (though putting them in another class and wrapping them lets you easily change it in the future, like to GraphQL over phoenix websockets or something).</p>
</blockquote>
</aside>
<p>Ok, when you are using “WebSockets” - but when you are using Phoenix channels (which by default use a WebSocket) you should use <a href="https://github.com/phoenixframework/phoenix/blob/master/assets/js/phoenix.js" rel="noopener nofollow ugc">phoenix.js</a>, <a href="https://github.com/phoenixframework/phoenix/blob/master/installer/templates/phx_assets/brunch/socket.js" rel="noopener nofollow ugc">socket.js</a>. (<a href="http://www.phoenixframework.org/docs/channels#section-joining-channels" rel="nofollow">Joining Channels</a>)</p>
<p>The Phoenix <code>socket</code> abstraction is by default backed by a WebSocket - and you get a channel from the Phoenix <code>socket</code>.</p>
<blockquote>
<p>The default transport mechanism is via WebSockets which will fall back to LongPolling if WebSockets are not available.</p>
</blockquote>
<p>.</p>
<blockquote>
<p>Phoenix holds a single connection to the server and multiplexes your channel sockets over that one connection.</p>
</blockquote> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="33464" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/help-making-a-design-choice-ajax-vs-websocket/5145/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-33464" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="33464"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="33520" data-post-id="33520">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="manukall" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/manukall/120/20326_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  manukall
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="13" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>Hmmm such as?  Take GraphQL over websockets, there are libraries out that simplify that trivially.  Or just make the raw channel calls, which is simple json.</p>
</blockquote>
</aside>
<p>Such as “Which channel do I join”?, “What message do I send to ask for a list of data?”, “What message do I send to ask for a specific resource?”, “What message do I send to create/update a resource?”, “How do I handle validation-/authorization-/other kinds of errors?” With a basic REST API, all of that is pretty clear. You can even have phoenix generate the basics for you. With channels I’m not aware of any established best practices for that, which I think is a big, big disadvantage WHEN LEARNING.</p>
<p>GraphQL is really cool, I’m using it myself. However, if you’re learning Phoenix and Vue, adding GraphQL will add another new thing you need to learn. And making it work with websockets/channels is yet another non-standard thing. There’s Absinthe.Plug, but I don’t know of an out of the box solution for GraphQL over channels.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="33520" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/help-making-a-design-choice-ajax-vs-websocket/5145/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-33520" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="33520"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="33522" data-post-id="33522">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="idi527" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  idi527
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<blockquote>
<p>There’s Absinthe.Plug, but I don’t know of an out of the box solution for GraphQL over channels.</p>
</blockquote>
<p>I think graphql subscriptions (graphql over websocket) will be available in absinthe sometime soon [0][1]. Not sure if they are intended to complement or replace phoenix channels, though.</p>
<p>[0] <a href="https://github.com/absinthe-graphql/absinthe/issues/156" class="inline-onebox" rel="noopener nofollow ugc">GraphQL Subscriptions · Issue #156 · absinthe-graphql/absinthe · GitHub</a><br>
[1] <a href="https://github.com/absinthe-graphql/absinthe/pull/322" class="inline-onebox" rel="noopener nofollow ugc">Subscriptions by benwilson512 · Pull Request #322 · absinthe-graphql/absinthe · GitHub</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="33522" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/help-making-a-design-choice-ajax-vs-websocket/5145/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-33522" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="33522"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="33579" data-post-id="33579">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="manukall" data-post="19" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/manukall/48/20326_2.png" class="avatar"> manukall:</div>
<blockquote>
<p>“Which channel do I join”?</p>
</blockquote>
</aside>
<p>Whatever your want, that is your creation.  ^.^</p>
<aside class="quote no-group" data-username="manukall" data-post="19" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/manukall/48/20326_2.png" class="avatar"> manukall:</div>
<blockquote>
<p>“What message do I send to ask for a list of data?”</p>
</blockquote>
</aside>
<p>Whatever your want, that is also your creation.  ^.^</p>
<aside class="quote no-group" data-username="manukall" data-post="19" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/manukall/48/20326_2.png" class="avatar"> manukall:</div>
<blockquote>
<p>“What message do I send to ask for a specific resource?”</p>
</blockquote>
</aside>
<p>Also whatever your want, that is your creation.  ^.^</p>
<aside class="quote no-group" data-username="manukall" data-post="19" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/manukall/48/20326_2.png" class="avatar"> manukall:</div>
<blockquote>
<p>“How do I handle validation-/authorization-/other kinds of errors?”</p>
</blockquote>
</aside>
<p>Ditto, sensing a pattern yet?  <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20"></p>
<aside class="quote no-group" data-username="manukall" data-post="19" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/manukall/48/20326_2.png" class="avatar"> manukall:</div>
<blockquote>
<p>With a basic REST API, all of that is pretty clear.</p>
</blockquote>
</aside>
<p>Not really, same decisions with rest.  Names of endpoints, connections, what data can be served, how to query for it, etc… etc… etc..  <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20"></p>
<aside class="quote no-group" data-username="manukall" data-post="19" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/manukall/48/20326_2.png" class="avatar"> manukall:</div>
<blockquote>
<p>With a basic REST API, all of that is pretty clear. You can even have phoenix generate the basics for you.</p>
</blockquote>
</aside>
<p>That template is an example, it is <em>not</em> a full REST endpoint, it is for interacting with only a single schema, and I near never see just single schema’s asked for or queried for.</p>
<aside class="quote no-group" data-username="manukall" data-post="19" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/manukall/48/20326_2.png" class="avatar"> manukall:</div>
<blockquote>
<p>With channels I’m not aware of any established best practices for that, which I think is a big, big disadvantage WHEN LEARNING.</p>
</blockquote>
</aside>
<p>Phoenix has default templates for those too, but again it all depends on just ‘what’ you are trying to accomplish.</p>
<aside class="quote no-group" data-username="manukall" data-post="19" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/manukall/48/20326_2.png" class="avatar"> manukall:</div>
<blockquote>
<p>GraphQL is really cool, I’m using it myself. However, if you’re learning Phoenix and Vue, adding GraphQL will add another new thing you need to learn.</p>
</blockquote>
</aside>
<p>GraphQL is just a query, think SQL, but for JSON, still very succinct and simple, it is not bound to any specific transport medium, only that GraphQL is a request and it returns JSON.  You can use it over endpoints, channels, raw TCP, whatever.  And GraphQL is quite used, there is plenty of documentation on it out there.  Using it with channels all I did was just have a single message that I named “request” and I just take the string from it and call absinthe with it and return the results, it is the same thing you do if it is on an endpoint (though it has a plug that can save you that step, though piddly a step it is).</p>
<aside class="quote no-group" data-username="idi527" data-post="20" data-topic="5145">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/i/85e7bf/48.png" class="avatar"> idi527:</div>
<blockquote>
<p>I think graphql subscriptions (graphql over websocket) will be available in absinthe sometime soon [0][1]. Not sure if they are intended to complement or replace phoenix channels, though.</p>
</blockquote>
</aside>
<p>GraphQL Subscriptions are a new GraphQL thing (not in absinthe, they are new in general), it just lets you basically ‘register’ to a query and you get the response like normal, except you keep getting responses again and again as it changes.  ^.^</p>
<p>That would be trivial to push over websockets as well.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="33579" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/help-making-a-design-choice-ajax-vs-websocket/5145/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-33579" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="33579"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/5145/load_more?page=3">Load more posts (18 remaining)</a>
</div></template></turbo-stream>