-
Notifications
You must be signed in to change notification settings - Fork 434
GraphQL-WS crate and Warp subscriptions update #721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,695
−237
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
31e1c45
update pre-existing juniper_warp::subscriptions
ccbrown 3dd6b6b
initial draft
ccbrown ac7ea1f
finish up, update example
ccbrown eae4300
polish + timing test
ccbrown ad9ebe4
fix pre-existing bug
ccbrown cae5a5a
rebase updates
ccbrown c2c631f
address comments
ccbrown d4e39c5
add release.toml
ccbrown 6bd4690
makefile and initial changelog
ccbrown fd6c442
add new Cargo.toml to juniper/release.toml
ccbrown File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# master | ||
|
||
- Initial Release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "juniper_graphql_ws" | ||
version = "0.1.0" | ||
authors = ["Christopher Brown <[email protected]>"] | ||
license = "BSD-2-Clause" | ||
description = "Graphql-ws protocol implementation for Juniper" | ||
documentation = "https://docs.rs/juniper_graphql_ws" | ||
repository = "https://github.com/graphql-rust/juniper" | ||
keywords = ["graphql-ws", "juniper", "graphql", "apollo"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
juniper = { version = "0.14.2", path = "../juniper", default-features = false } | ||
juniper_subscriptions = { path = "../juniper_subscriptions" } | ||
serde = { version = "1.0.8", features = ["derive"] } | ||
tokio = { version = "0.2", features = ["macros", "rt-core", "time"] } | ||
|
||
[dev-dependencies] | ||
serde_json = { version = "1.0.2" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[env] | ||
CARGO_MAKE_CARGO_ALL_FEATURES = "" | ||
|
||
[tasks.build-verbose] | ||
condition = { rust_version = { min = "1.29.0" } } | ||
|
||
[tasks.build-verbose.windows] | ||
condition = { rust_version = { min = "1.29.0" }, env = { "TARGET" = "x86_64-pc-windows-msvc" } } | ||
|
||
[tasks.test-verbose] | ||
condition = { rust_version = { min = "1.29.0" } } | ||
|
||
[tasks.test-verbose.windows] | ||
condition = { rust_version = { min = "1.29.0" }, env = { "TARGET" = "x86_64-pc-windows-msvc" } } | ||
|
||
[tasks.ci-coverage-flow] | ||
condition = { rust_version = { min = "1.29.0" } } | ||
|
||
[tasks.ci-coverage-flow.windows] | ||
disabled = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
no-dev-version = true | ||
pre-release-commit-message = "Release {{crate_name}} {{version}}" | ||
pro-release-commit-message = "Bump {{crate_name}} version to {{next_version}}" | ||
tag-message = "Release {{crate_name}} {{version}}" | ||
upload-doc = false | ||
pre-release-replacements = [ | ||
{file="src/lib.rs", search="docs.rs/juniper_graphql_ws/[a-z0-9\\.-]+", replace="docs.rs/juniper_graphql_ws/{{version}}"}, | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
use juniper::{ScalarValue, Variables}; | ||
|
||
/// The payload for a client's "start" message. This triggers execution of a query, mutation, or | ||
/// subscription. | ||
#[derive(Debug, Deserialize, PartialEq)] | ||
#[serde(bound(deserialize = "S: ScalarValue"))] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct StartPayload<S: ScalarValue> { | ||
/// The document body. | ||
pub query: String, | ||
|
||
/// The optional variables. | ||
#[serde(default)] | ||
pub variables: Variables<S>, | ||
|
||
/// The optional operation name (required if the document contains multiple operations). | ||
pub operation_name: Option<String>, | ||
} | ||
|
||
/// ClientMessage defines the message types that clients can send. | ||
#[derive(Debug, Deserialize, PartialEq)] | ||
#[serde(bound(deserialize = "S: ScalarValue"))] | ||
#[serde(rename_all = "snake_case")] | ||
#[serde(tag = "type")] | ||
pub enum ClientMessage<S: ScalarValue> { | ||
/// ConnectionInit is sent by the client upon connecting. | ||
ConnectionInit { | ||
/// Optional parameters of any type sent from the client. These are often used for | ||
/// authentication. | ||
#[serde(default)] | ||
payload: Variables<S>, | ||
}, | ||
/// Start messages are used to execute a GraphQL operation. | ||
Start { | ||
/// The id of the operation. This can be anything, but must be unique. If there are other | ||
/// in-flight operations with the same id, the message will be ignored or cause an error. | ||
id: String, | ||
|
||
/// The query, variables, and operation name. | ||
payload: StartPayload<S>, | ||
}, | ||
/// Stop messages are used to unsubscribe from a subscription. | ||
Stop { | ||
/// The id of the operation to stop. | ||
id: String, | ||
}, | ||
/// ConnectionTerminate is used to terminate the connection. | ||
ConnectionTerminate, | ||
} | ||
|
||
#[cfg(test)] | ||
mod test { | ||
use super::*; | ||
use juniper::{DefaultScalarValue, InputValue}; | ||
|
||
#[test] | ||
fn test_deserialization() { | ||
type ClientMessage = super::ClientMessage<DefaultScalarValue>; | ||
|
||
assert_eq!( | ||
ClientMessage::ConnectionInit { | ||
payload: [("foo".to_string(), InputValue::scalar("bar"))] | ||
.iter() | ||
.cloned() | ||
.collect(), | ||
}, | ||
serde_json::from_str(r##"{"type": "connection_init", "payload": {"foo": "bar"}}"##) | ||
.unwrap(), | ||
); | ||
|
||
assert_eq!( | ||
ClientMessage::ConnectionInit { | ||
payload: Variables::default(), | ||
}, | ||
serde_json::from_str(r##"{"type": "connection_init"}"##).unwrap(), | ||
); | ||
|
||
assert_eq!( | ||
ClientMessage::Start { | ||
id: "foo".to_string(), | ||
payload: StartPayload { | ||
query: "query MyQuery { __typename }".to_string(), | ||
variables: [("foo".to_string(), InputValue::scalar("bar"))] | ||
.iter() | ||
.cloned() | ||
.collect(), | ||
operation_name: Some("MyQuery".to_string()), | ||
}, | ||
}, | ||
serde_json::from_str( | ||
r##"{"type": "start", "id": "foo", "payload": { | ||
"query": "query MyQuery { __typename }", | ||
"variables": { | ||
"foo": "bar" | ||
}, | ||
"operationName": "MyQuery" | ||
}}"## | ||
) | ||
.unwrap(), | ||
); | ||
|
||
assert_eq!( | ||
ClientMessage::Start { | ||
id: "foo".to_string(), | ||
payload: StartPayload { | ||
query: "query MyQuery { __typename }".to_string(), | ||
variables: Variables::default(), | ||
operation_name: None, | ||
}, | ||
}, | ||
serde_json::from_str( | ||
r##"{"type": "start", "id": "foo", "payload": { | ||
"query": "query MyQuery { __typename }" | ||
}}"## | ||
) | ||
.unwrap(), | ||
); | ||
|
||
assert_eq!( | ||
ClientMessage::Stop { | ||
id: "foo".to_string() | ||
}, | ||
serde_json::from_str(r##"{"type": "stop", "id": "foo"}"##).unwrap(), | ||
); | ||
|
||
assert_eq!( | ||
ClientMessage::ConnectionTerminate, | ||
serde_json::from_str(r##"{"type": "connection_terminate"}"##).unwrap(), | ||
); | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
use juniper::{GraphQLSubscriptionType, GraphQLTypeAsync, RootNode, ScalarValue}; | ||
use std::sync::Arc; | ||
|
||
/// Schema defines the requirements for schemas that can be used for operations. Typically this is | ||
/// just an `Arc<RootNode<...>>` and you should not have to implement it yourself. | ||
pub trait Schema: Unpin + Clone + Send + Sync + 'static { | ||
/// The context type. | ||
type Context: Unpin + Send + Sync; | ||
|
||
/// The scalar value type. | ||
type ScalarValue: ScalarValue + Send + Sync; | ||
|
||
/// The query type info. | ||
type QueryTypeInfo: Send + Sync; | ||
|
||
/// The query type. | ||
type Query: GraphQLTypeAsync<Self::ScalarValue, Context = Self::Context, TypeInfo = Self::QueryTypeInfo> | ||
+ Send; | ||
|
||
/// The mutation type info. | ||
type MutationTypeInfo: Send + Sync; | ||
|
||
/// The mutation type. | ||
type Mutation: GraphQLTypeAsync< | ||
Self::ScalarValue, | ||
Context = Self::Context, | ||
TypeInfo = Self::MutationTypeInfo, | ||
> + Send; | ||
|
||
/// The subscription type info. | ||
type SubscriptionTypeInfo: Send + Sync; | ||
|
||
/// The subscription type. | ||
type Subscription: GraphQLSubscriptionType< | ||
Self::ScalarValue, | ||
Context = Self::Context, | ||
TypeInfo = Self::SubscriptionTypeInfo, | ||
> + Send; | ||
|
||
/// Returns the root node for the schema. | ||
fn root_node( | ||
&self, | ||
) -> &RootNode<'static, Self::Query, Self::Mutation, Self::Subscription, Self::ScalarValue>; | ||
} | ||
|
||
/// This exists as a work-around for this issue: https://github.com/rust-lang/rust/issues/64552 | ||
/// | ||
/// It can be used in generators where using Arc directly would result in an error. | ||
// TODO: Remove this once that issue is resolved. | ||
#[doc(hidden)] | ||
pub struct ArcSchema<QueryT, MutationT, SubscriptionT, CtxT, S>( | ||
pub Arc<RootNode<'static, QueryT, MutationT, SubscriptionT, S>>, | ||
) | ||
where | ||
QueryT: GraphQLTypeAsync<S, Context = CtxT> + Send + 'static, | ||
QueryT::TypeInfo: Send + Sync, | ||
MutationT: GraphQLTypeAsync<S, Context = CtxT> + Send + 'static, | ||
MutationT::TypeInfo: Send + Sync, | ||
SubscriptionT: GraphQLSubscriptionType<S, Context = CtxT> + Send + 'static, | ||
SubscriptionT::TypeInfo: Send + Sync, | ||
CtxT: Unpin + Send + Sync, | ||
S: ScalarValue + Send + Sync + 'static; | ||
|
||
impl<QueryT, MutationT, SubscriptionT, CtxT, S> Clone | ||
for ArcSchema<QueryT, MutationT, SubscriptionT, CtxT, S> | ||
where | ||
QueryT: GraphQLTypeAsync<S, Context = CtxT> + Send + 'static, | ||
QueryT::TypeInfo: Send + Sync, | ||
MutationT: GraphQLTypeAsync<S, Context = CtxT> + Send + 'static, | ||
MutationT::TypeInfo: Send + Sync, | ||
SubscriptionT: GraphQLSubscriptionType<S, Context = CtxT> + Send + 'static, | ||
SubscriptionT::TypeInfo: Send + Sync, | ||
CtxT: Unpin + Send + Sync, | ||
S: ScalarValue + Send + Sync + 'static, | ||
{ | ||
fn clone(&self) -> Self { | ||
Self(self.0.clone()) | ||
} | ||
} | ||
|
||
impl<QueryT, MutationT, SubscriptionT, CtxT, S> Schema | ||
for ArcSchema<QueryT, MutationT, SubscriptionT, CtxT, S> | ||
where | ||
QueryT: GraphQLTypeAsync<S, Context = CtxT> + Send + 'static, | ||
QueryT::TypeInfo: Send + Sync, | ||
MutationT: GraphQLTypeAsync<S, Context = CtxT> + Send + 'static, | ||
MutationT::TypeInfo: Send + Sync, | ||
SubscriptionT: GraphQLSubscriptionType<S, Context = CtxT> + Send + 'static, | ||
SubscriptionT::TypeInfo: Send + Sync, | ||
CtxT: Unpin + Send + Sync + 'static, | ||
S: ScalarValue + Send + Sync + 'static, | ||
{ | ||
type Context = CtxT; | ||
type ScalarValue = S; | ||
type QueryTypeInfo = QueryT::TypeInfo; | ||
type Query = QueryT; | ||
type MutationTypeInfo = MutationT::TypeInfo; | ||
type Mutation = MutationT; | ||
type SubscriptionTypeInfo = SubscriptionT::TypeInfo; | ||
type Subscription = SubscriptionT; | ||
|
||
fn root_node(&self) -> &RootNode<'static, QueryT, MutationT, SubscriptionT, S> { | ||
&self.0 | ||
} | ||
} | ||
|
||
impl<QueryT, MutationT, SubscriptionT, CtxT, S> Schema | ||
for Arc<RootNode<'static, QueryT, MutationT, SubscriptionT, S>> | ||
where | ||
QueryT: GraphQLTypeAsync<S, Context = CtxT> + Send + 'static, | ||
QueryT::TypeInfo: Send + Sync, | ||
MutationT: GraphQLTypeAsync<S, Context = CtxT> + Send + 'static, | ||
MutationT::TypeInfo: Send + Sync, | ||
SubscriptionT: GraphQLSubscriptionType<S, Context = CtxT> + Send + 'static, | ||
SubscriptionT::TypeInfo: Send + Sync, | ||
CtxT: Unpin + Send + Sync, | ||
S: ScalarValue + Send + Sync + 'static, | ||
{ | ||
type Context = CtxT; | ||
type ScalarValue = S; | ||
type QueryTypeInfo = QueryT::TypeInfo; | ||
type Query = QueryT; | ||
type MutationTypeInfo = MutationT::TypeInfo; | ||
type Mutation = MutationT; | ||
type SubscriptionTypeInfo = SubscriptionT::TypeInfo; | ||
type Subscription = SubscriptionT; | ||
|
||
fn root_node(&self) -> &RootNode<'static, QueryT, MutationT, SubscriptionT, S> { | ||
self | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
use juniper::{ExecutionError, GraphQLError, ScalarValue, Value}; | ||
use serde::{Serialize, Serializer}; | ||
use std::{any::Any, fmt, marker::PhantomPinned}; | ||
|
||
/// The payload for errors that are not associated with a GraphQL operation. | ||
#[derive(Debug, Serialize, PartialEq)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ConnectionErrorPayload { | ||
/// The error message. | ||
pub message: String, | ||
} | ||
|
||
/// Sent after execution of an operation. For queries and mutations, this is sent to the client | ||
/// once. For subscriptions, this is sent for every event in the event stream. | ||
#[derive(Debug, Serialize, PartialEq)] | ||
#[serde(bound(serialize = "S: ScalarValue"))] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct DataPayload<S> { | ||
/// The result data. | ||
pub data: Value<S>, | ||
|
||
/// The errors that have occurred during execution. Note that parse and validation errors are | ||
/// not included here. They are sent via Error messages. | ||
pub errors: Vec<ExecutionError<S>>, | ||
} | ||
|
||
/// A payload for errors that can happen before execution. Errors that happen during execution are | ||
/// instead sent to the client via `DataPayload`. `ErrorPayload` is a wrapper for an owned | ||
/// `GraphQLError`. | ||
// XXX: Think carefully before deriving traits. This is self-referential (error references | ||
// _execution_params). | ||
pub struct ErrorPayload { | ||
_execution_params: Option<Box<dyn Any + Send>>, | ||
error: GraphQLError<'static>, | ||
_marker: PhantomPinned, | ||
} | ||
|
||
impl ErrorPayload { | ||
/// For this to be okay, the caller must guarantee that the error can only reference data from | ||
/// execution_params and that execution_params has not been modified or moved. | ||
pub(crate) unsafe fn new_unchecked<'a>( | ||
execution_params: Box<dyn Any + Send>, | ||
error: GraphQLError<'a>, | ||
) -> Self { | ||
Self { | ||
_execution_params: Some(execution_params), | ||
error: std::mem::transmute(error), | ||
_marker: PhantomPinned, | ||
} | ||
} | ||
|
||
/// Returns the contained GraphQLError. | ||
pub fn graphql_error<'a>(&'a self) -> &GraphQLError<'a> { | ||
&self.error | ||
} | ||
} | ||
|
||
impl fmt::Debug for ErrorPayload { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
self.error.fmt(f) | ||
} | ||
} | ||
|
||
impl PartialEq for ErrorPayload { | ||
fn eq(&self, other: &Self) -> bool { | ||
self.error.eq(&other.error) | ||
} | ||
} | ||
|
||
impl Serialize for ErrorPayload { | ||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> | ||
where | ||
S: Serializer, | ||
{ | ||
self.error.serialize(serializer) | ||
} | ||
} | ||
|
||
impl From<GraphQLError<'static>> for ErrorPayload { | ||
fn from(error: GraphQLError<'static>) -> Self { | ||
Self { | ||
_execution_params: None, | ||
error, | ||
_marker: PhantomPinned, | ||
} | ||
} | ||
} | ||
|
||
/// ServerMessage defines the message types that servers can send. | ||
#[derive(Debug, Serialize, PartialEq)] | ||
#[serde(bound(serialize = "S: ScalarValue"))] | ||
#[serde(rename_all = "snake_case")] | ||
#[serde(tag = "type")] | ||
pub enum ServerMessage<S: ScalarValue> { | ||
/// ConnectionError is used for errors that are not associated with a GraphQL operation. For | ||
/// example, this will be used when: | ||
/// | ||
/// * The server is unable to parse a client's message. | ||
/// * The client's initialization parameters are rejected. | ||
ConnectionError { | ||
/// The error that occurred. | ||
payload: ConnectionErrorPayload, | ||
}, | ||
/// ConnectionAck is sent in response to a client's ConnectionInit message if the server accepted a | ||
/// connection. | ||
ConnectionAck, | ||
/// Data contains the result of a query, mutation, or subscription event. | ||
Data { | ||
/// The id of the operation that the data is for. | ||
id: String, | ||
|
||
/// The data and errors that occurred during execution. | ||
payload: DataPayload<S>, | ||
}, | ||
/// Error contains an error that occurs before execution, such as validation errors. | ||
Error { | ||
/// The id of the operation that triggered this error. | ||
id: String, | ||
|
||
/// The error(s). | ||
payload: ErrorPayload, | ||
}, | ||
/// Complete indicates that no more data will be sent for the given operation. | ||
Complete { | ||
/// The id of the operation that has completed. | ||
id: String, | ||
}, | ||
/// ConnectionKeepAlive is sent periodically after accepting a connection. | ||
#[serde(rename = "ka")] | ||
ConnectionKeepAlive, | ||
} | ||
|
||
#[cfg(test)] | ||
mod test { | ||
use super::*; | ||
use juniper::DefaultScalarValue; | ||
|
||
#[test] | ||
fn test_serialization() { | ||
type ServerMessage = super::ServerMessage<DefaultScalarValue>; | ||
|
||
assert_eq!( | ||
serde_json::to_string(&ServerMessage::ConnectionError { | ||
payload: ConnectionErrorPayload { | ||
message: "foo".to_string(), | ||
}, | ||
}) | ||
.unwrap(), | ||
r##"{"type":"connection_error","payload":{"message":"foo"}}"##, | ||
); | ||
|
||
assert_eq!( | ||
serde_json::to_string(&ServerMessage::ConnectionAck).unwrap(), | ||
r##"{"type":"connection_ack"}"##, | ||
); | ||
|
||
assert_eq!( | ||
serde_json::to_string(&ServerMessage::Data { | ||
id: "foo".to_string(), | ||
payload: DataPayload { | ||
data: Value::null(), | ||
errors: vec![], | ||
}, | ||
}) | ||
.unwrap(), | ||
r##"{"type":"data","id":"foo","payload":{"data":null,"errors":[]}}"##, | ||
); | ||
|
||
assert_eq!( | ||
serde_json::to_string(&ServerMessage::Error { | ||
id: "foo".to_string(), | ||
payload: GraphQLError::UnknownOperationName.into(), | ||
}) | ||
.unwrap(), | ||
r##"{"type":"error","id":"foo","payload":[{"message":"Unknown operation"}]}"##, | ||
); | ||
|
||
assert_eq!( | ||
serde_json::to_string(&ServerMessage::Complete { | ||
id: "foo".to_string(), | ||
}) | ||
.unwrap(), | ||
r##"{"type":"complete","id":"foo"}"##, | ||
); | ||
|
||
assert_eq!( | ||
serde_json::to_string(&ServerMessage::ConnectionKeepAlive).unwrap(), | ||
r##"{"type":"ka"}"##, | ||
); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to put this on the route?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seemed simpler to me, but if someone with more Warp expertise tells me it would be better for whatever reason (demonstration purposes?), I'm happy to change it.