{"action":"created","comment":{"url":"https://api.github.com/repos/graphql-rust/juniper/pulls/comments/211446960","pull_request_review_id":147867873,"id":211446960,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTQ0Njk2MA==","diff_hunk":"@@ -0,0 +1,363 @@\n+/*!\n+\n+# juniper_warp\n+\n+This repository contains the [warp][warp] web server integration for\n+[Juniper][Juniper], a [GraphQL][GraphQL] implementation for Rust.\n+\n+## Documentation\n+\n+For documentation, including guides and examples, check out [Juniper][Juniper].\n+\n+A basic usage example can also be found in the [Api documentation][documentation].\n+\n+## Examples\n+\n+Check [examples/warp_server][example] for example code of a working warp\n+server with GraphQL handlers.\n+\n+## Links\n+\n+* [Juniper][Juniper]\n+* [Api Reference][documentation]\n+* [warp][warp]\n+\n+## License\n+\n+This project is under the BSD-2 license.\n+\n+Check the LICENSE file for details.\n+\n+[warp]: https://github.com/seanmonstar/warp\n+[Juniper]: https://github.com/graphql-rust/juniper\n+[GraphQL]: http://graphql.org\n+[documentation]: https://docs.rs/juniper_warp\n+[example]: https://github.com/graphql-rust/juniper_warp/blob/master/examples/warp_server\n+\n+*/\n+\n+#![deny(missing_docs)]\n+#![deny(warnings)]\n+\n+#[macro_use]\n+extern crate failure;\n+extern crate juniper;\n+extern crate serde_json;\n+extern crate warp;\n+\n+#[cfg(test)]\n+extern crate percent_encoding;\n+\n+use std::sync::Arc;\n+use warp::{filters::BoxedFilter, Filter};\n+\n+/// Make a filter for graphql endpoint.\n+///\n+/// The `schema` argument is your juniper schema.\n+///\n+/// The `context_extractor` argument should be a filter that provides the GraphQL context required by the schema.\n+///\n+/// Example:\n+///\n+/// ```\n+/// # extern crate juniper_warp;\n+/// # #[macro_use]\n+/// # extern crate juniper;\n+/// # extern crate warp;\n+/// #\n+/// # use std::sync::Arc;\n+/// # use warp::Filter;\n+/// # use juniper::{EmptyMutation, RootNode};\n+/// # use juniper_warp::make_graphql_filter;\n+/// #\n+/// # fn main() {\n+/// type UserId = String;\n+/// # #[derive(Debug)]\n+/// struct AppState(Vec<i64>);\n+/// struct ExampleContext(Arc<AppState>, UserId);\n+///\n+/// struct QueryRoot;\n+///\n+/// graphql_object! (QueryRoot: ExampleContext |&self| {\n+///     field say_hello(&executor) -> String {\n+///         let context = executor.context();\n+///\n+///         format!(\"good morning {}, the app state is {:?}\", context.1, context.0)\n+///     }\n+/// });\n+///\n+/// let schema = RootNode::new(QueryRoot, EmptyMutation::new());\n+///\n+/// let app_state = Arc::new(AppState(vec![3, 4, 5]));\n+/// let app_state = warp::any().map(move || app_state.clone());\n+///\n+/// let context_extractor = warp::any()\n+///     .and(warp::header::<String>(\"authorization\"))\n+///     .and(app_state)\n+///     .map(|auth_header: String, app_state: Arc<AppState>| {\n+///         let user_id = auth_header; // we believe them\n+///         ExampleContext(app_state, user_id)\n+///     })\n+///     .boxed();\n+///\n+/// let graphql_filter = make_graphql_filter(schema, context_extractor);\n+///\n+/// let graphql_endpoint = warp::path(\"graphql\")\n+///     .and(warp::post(graphql_filter));","path":"juniper_warp/src/lib.rs","position":106,"original_position":106,"commit_id":"08849f80c34d3e69ed9a5a25e39e9835b678ed32","original_commit_id":"08849f80c34d3e69ed9a5a25e39e9835b678ed32","user":{"login":"LegNeato","id":368904,"node_id":"MDQ6VXNlcjM2ODkwNA==","avatar_url":"https://avatars0.githubusercontent.com/u/368904?v=4","gravatar_id":"","url":"https://api.github.com/users/LegNeato","html_url":"https://github.com/LegNeato","followers_url":"https://api.github.com/users/LegNeato/followers","following_url":"https://api.github.com/users/LegNeato/following{/other_user}","gists_url":"https://api.github.com/users/LegNeato/gists{/gist_id}","starred_url":"https://api.github.com/users/LegNeato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LegNeato/subscriptions","organizations_url":"https://api.github.com/users/LegNeato/orgs","repos_url":"https://api.github.com/users/LegNeato/repos","events_url":"https://api.github.com/users/LegNeato/events{/privacy}","received_events_url":"https://api.github.com/users/LegNeato/received_events","type":"User","site_admin":false},"body":"👍 ","created_at":"2018-08-21T00:23:52Z","updated_at":"2018-08-21T00:28:09Z","html_url":"https://github.com/graphql-rust/juniper/pull/216#discussion_r211446960","pull_request_url":"https://api.github.com/repos/graphql-rust/juniper/pulls/216","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/graphql-rust/juniper/pulls/comments/211446960"},"html":{"href":"https://github.com/graphql-rust/juniper/pull/216#discussion_r211446960"},"pull_request":{"href":"https://api.github.com/repos/graphql-rust/juniper/pulls/216"}},"in_reply_to_id":211270188},"pull_request":{"url":"https://api.github.com/repos/graphql-rust/juniper/pulls/216","id":206075169,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2MDc1MTY5","html_url":"https://github.com/graphql-rust/juniper/pull/216","diff_url":"https://github.com/graphql-rust/juniper/pull/216.diff","patch_url":"https://github.com/graphql-rust/juniper/pull/216.patch","issue_url":"https://api.github.com/repos/graphql-rust/juniper/issues/216","number":216,"state":"open","locked":false,"title":"Add integration crate for the warp framework","user":{"login":"tomhoule","id":13155277,"node_id":"MDQ6VXNlcjEzMTU1Mjc3","avatar_url":"https://avatars2.githubusercontent.com/u/13155277?v=4","gravatar_id":"","url":"https://api.github.com/users/tomhoule","html_url":"https://github.com/tomhoule","followers_url":"https://api.github.com/users/tomhoule/followers","following_url":"https://api.github.com/users/tomhoule/following{/other_user}","gists_url":"https://api.github.com/users/tomhoule/gists{/gist_id}","starred_url":"https://api.github.com/users/tomhoule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomhoule/subscriptions","organizations_url":"https://api.github.com/users/tomhoule/orgs","repos_url":"https://api.github.com/users/tomhoule/repos","events_url":"https://api.github.com/users/tomhoule/events{/privacy}","received_events_url":"https://api.github.com/users/tomhoule/received_events","type":"User","site_admin":false},"body":"I think this still needs more testing but coming up with this integration was very smooth and it feels like idiomatic warp (I've only been programming with warp since its first public release, so yesterday :)).\r\n\r\nI'll keep working on polishing this over the weekend (docs, tests) but feedback would still be appreciated.\r\n\r\nThis notably does not have support for batch requests. Should it be implemented in this PR or can it be done separately?","created_at":"2018-08-03T16:08:20Z","updated_at":"2018-08-21T00:28:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"26f31a0ebd115cd58ff8037d8cdf9b0955a1cda9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/graphql-rust/juniper/pulls/216/commits","review_comments_url":"https://api.github.com/repos/graphql-rust/juniper/pulls/216/comments","review_comment_url":"https://api.github.com/repos/graphql-rust/juniper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/graphql-rust/juniper/issues/216/comments","statuses_url":"https://api.github.com/repos/graphql-rust/juniper/statuses/08849f80c34d3e69ed9a5a25e39e9835b678ed32","head":{"label":"tomhoule:juniper-warp","ref":"juniper-warp","sha":"08849f80c34d3e69ed9a5a25e39e9835b678ed32","user":{"login":"tomhoule","id":13155277,"node_id":"MDQ6VXNlcjEzMTU1Mjc3","avatar_url":"https://avatars2.githubusercontent.com/u/13155277?v=4","gravatar_id":"","url":"https://api.github.com/users/tomhoule","html_url":"https://github.com/tomhoule","followers_url":"https://api.github.com/users/tomhoule/followers","following_url":"https://api.github.com/users/tomhoule/following{/other_user}","gists_url":"https://api.github.com/users/tomhoule/gists{/gist_id}","starred_url":"https://api.github.com/users/tomhoule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomhoule/subscriptions","organizations_url":"https://api.github.com/users/tomhoule/orgs","repos_url":"https://api.github.com/users/tomhoule/repos","events_url":"https://api.github.com/users/tomhoule/events{/privacy}","received_events_url":"https://api.github.com/users/tomhoule/received_events","type":"User","site_admin":false},"repo":{"id":143380229,"node_id":"MDEwOlJlcG9zaXRvcnkxNDMzODAyMjk=","name":"juniper","full_name":"tomhoule/juniper","owner":{"login":"tomhoule","id":13155277,"node_id":"MDQ6VXNlcjEzMTU1Mjc3","avatar_url":"https://avatars2.githubusercontent.com/u/13155277?v=4","gravatar_id":"","url":"https://api.github.com/users/tomhoule","html_url":"https://github.com/tomhoule","followers_url":"https://api.github.com/users/tomhoule/followers","following_url":"https://api.github.com/users/tomhoule/following{/other_user}","gists_url":"https://api.github.com/users/tomhoule/gists{/gist_id}","starred_url":"https://api.github.com/users/tomhoule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomhoule/subscriptions","organizations_url":"https://api.github.com/users/tomhoule/orgs","repos_url":"https://api.github.com/users/tomhoule/repos","events_url":"https://api.github.com/users/tomhoule/events{/privacy}","received_events_url":"https://api.github.com/users/tomhoule/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tomhoule/juniper","description":"GraphQL server library for Rust","fork":true,"url":"https://api.github.com/repos/tomhoule/juniper","forks_url":"https://api.github.com/repos/tomhoule/juniper/forks","keys_url":"https://api.github.com/repos/tomhoule/juniper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomhoule/juniper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomhoule/juniper/teams","hooks_url":"https://api.github.com/repos/tomhoule/juniper/hooks","issue_events_url":"https://api.github.com/repos/tomhoule/juniper/issues/events{/number}","events_url":"https://api.github.com/repos/tomhoule/juniper/events","assignees_url":"https://api.github.com/repos/tomhoule/juniper/assignees{/user}","branches_url":"https://api.github.com/repos/tomhoule/juniper/branches{/branch}","tags_url":"https://api.github.com/repos/tomhoule/juniper/tags","blobs_url":"https://api.github.com/repos/tomhoule/juniper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomhoule/juniper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomhoule/juniper/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomhoule/juniper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomhoule/juniper/statuses/{sha}","languages_url":"https://api.github.com/repos/tomhoule/juniper/languages","stargazers_url":"https://api.github.com/repos/tomhoule/juniper/stargazers","contributors_url":"https://api.github.com/repos/tomhoule/juniper/contributors","subscribers_url":"https://api.github.com/repos/tomhoule/juniper/subscribers","subscription_url":"https://api.github.com/repos/tomhoule/juniper/subscription","commits_url":"https://api.github.com/repos/tomhoule/juniper/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomhoule/juniper/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomhoule/juniper/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomhoule/juniper/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomhoule/juniper/contents/{+path}","compare_url":"https://api.github.com/repos/tomhoule/juniper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomhoule/juniper/merges","archive_url":"https://api.github.com/repos/tomhoule/juniper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomhoule/juniper/downloads","issues_url":"https://api.github.com/repos/tomhoule/juniper/issues{/number}","pulls_url":"https://api.github.com/repos/tomhoule/juniper/pulls{/number}","milestones_url":"https://api.github.com/repos/tomhoule/juniper/milestones{/number}","notifications_url":"https://api.github.com/repos/tomhoule/juniper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomhoule/juniper/labels{/name}","releases_url":"https://api.github.com/repos/tomhoule/juniper/releases{/id}","deployments_url":"https://api.github.com/repos/tomhoule/juniper/deployments","created_at":"2018-08-03T05:06:04Z","updated_at":"2018-08-03T05:06:07Z","pushed_at":"2018-08-20T10:48:48Z","git_url":"git://github.com/tomhoule/juniper.git","ssh_url":"git@github.com:tomhoule/juniper.git","clone_url":"https://github.com/tomhoule/juniper.git","svn_url":"https://github.com/tomhoule/juniper","homepage":null,"size":1029,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause","node_id":"MDc6TGljZW5zZTQ="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"graphql-rust:master","ref":"master","sha":"c04b06f79b3d741d19ca827adb022a1f2041e895","user":{"login":"graphql-rust","id":30779353,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwNzc5MzUz","avatar_url":"https://avatars1.githubusercontent.com/u/30779353?v=4","gravatar_id":"","url":"https://api.github.com/users/graphql-rust","html_url":"https://github.com/graphql-rust","followers_url":"https://api.github.com/users/graphql-rust/followers","following_url":"https://api.github.com/users/graphql-rust/following{/other_user}","gists_url":"https://api.github.com/users/graphql-rust/gists{/gist_id}","starred_url":"https://api.github.com/users/graphql-rust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphql-rust/subscriptions","organizations_url":"https://api.github.com/users/graphql-rust/orgs","repos_url":"https://api.github.com/users/graphql-rust/repos","events_url":"https://api.github.com/users/graphql-rust/events{/privacy}","received_events_url":"https://api.github.com/users/graphql-rust/received_events","type":"Organization","site_admin":false},"repo":{"id":67941656,"node_id":"MDEwOlJlcG9zaXRvcnk2Nzk0MTY1Ng==","name":"juniper","full_name":"graphql-rust/juniper","owner":{"login":"graphql-rust","id":30779353,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwNzc5MzUz","avatar_url":"https://avatars1.githubusercontent.com/u/30779353?v=4","gravatar_id":"","url":"https://api.github.com/users/graphql-rust","html_url":"https://github.com/graphql-rust","followers_url":"https://api.github.com/users/graphql-rust/followers","following_url":"https://api.github.com/users/graphql-rust/following{/other_user}","gists_url":"https://api.github.com/users/graphql-rust/gists{/gist_id}","starred_url":"https://api.github.com/users/graphql-rust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphql-rust/subscriptions","organizations_url":"https://api.github.com/users/graphql-rust/orgs","repos_url":"https://api.github.com/users/graphql-rust/repos","events_url":"https://api.github.com/users/graphql-rust/events{/privacy}","received_events_url":"https://api.github.com/users/graphql-rust/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/graphql-rust/juniper","description":"GraphQL server library for Rust","fork":false,"url":"https://api.github.com/repos/graphql-rust/juniper","forks_url":"https://api.github.com/repos/graphql-rust/juniper/forks","keys_url":"https://api.github.com/repos/graphql-rust/juniper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graphql-rust/juniper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graphql-rust/juniper/teams","hooks_url":"https://api.github.com/repos/graphql-rust/juniper/hooks","issue_events_url":"https://api.github.com/repos/graphql-rust/juniper/issues/events{/number}","events_url":"https://api.github.com/repos/graphql-rust/juniper/events","assignees_url":"https://api.github.com/repos/graphql-rust/juniper/assignees{/user}","branches_url":"https://api.github.com/repos/graphql-rust/juniper/branches{/branch}","tags_url":"https://api.github.com/repos/graphql-rust/juniper/tags","blobs_url":"https://api.github.com/repos/graphql-rust/juniper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graphql-rust/juniper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graphql-rust/juniper/git/refs{/sha}","trees_url":"https://api.github.com/repos/graphql-rust/juniper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graphql-rust/juniper/statuses/{sha}","languages_url":"https://api.github.com/repos/graphql-rust/juniper/languages","stargazers_url":"https://api.github.com/repos/graphql-rust/juniper/stargazers","contributors_url":"https://api.github.com/repos/graphql-rust/juniper/contributors","subscribers_url":"https://api.github.com/repos/graphql-rust/juniper/subscribers","subscription_url":"https://api.github.com/repos/graphql-rust/juniper/subscription","commits_url":"https://api.github.com/repos/graphql-rust/juniper/commits{/sha}","git_commits_url":"https://api.github.com/repos/graphql-rust/juniper/git/commits{/sha}","comments_url":"https://api.github.com/repos/graphql-rust/juniper/comments{/number}","issue_comment_url":"https://api.github.com/repos/graphql-rust/juniper/issues/comments{/number}","contents_url":"https://api.github.com/repos/graphql-rust/juniper/contents/{+path}","compare_url":"https://api.github.com/repos/graphql-rust/juniper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graphql-rust/juniper/merges","archive_url":"https://api.github.com/repos/graphql-rust/juniper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graphql-rust/juniper/downloads","issues_url":"https://api.github.com/repos/graphql-rust/juniper/issues{/number}","pulls_url":"https://api.github.com/repos/graphql-rust/juniper/pulls{/number}","milestones_url":"https://api.github.com/repos/graphql-rust/juniper/milestones{/number}","notifications_url":"https://api.github.com/repos/graphql-rust/juniper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graphql-rust/juniper/labels{/name}","releases_url":"https://api.github.com/repos/graphql-rust/juniper/releases{/id}","deployments_url":"https://api.github.com/repos/graphql-rust/juniper/deployments","created_at":"2016-09-11T16:43:19Z","updated_at":"2018-08-20T17:25:10Z","pushed_at":"2018-08-20T21:10:54Z","git_url":"git://github.com/graphql-rust/juniper.git","ssh_url":"git@github.com:graphql-rust/juniper.git","clone_url":"https://github.com/graphql-rust/juniper.git","svn_url":"https://github.com/graphql-rust/juniper","homepage":null,"size":1023,"stargazers_count":895,"watchers_count":895,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":69,"mirror_url":null,"archived":false,"open_issues_count":47,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause","node_id":"MDc6TGljZW5zZTQ="},"forks":69,"open_issues":47,"watchers":895,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/graphql-rust/juniper/pulls/216"},"html":{"href":"https://github.com/graphql-rust/juniper/pull/216"},"issue":{"href":"https://api.github.com/repos/graphql-rust/juniper/issues/216"},"comments":{"href":"https://api.github.com/repos/graphql-rust/juniper/issues/216/comments"},"review_comments":{"href":"https://api.github.com/repos/graphql-rust/juniper/pulls/216/comments"},"review_comment":{"href":"https://api.github.com/repos/graphql-rust/juniper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/graphql-rust/juniper/pulls/216/commits"},"statuses":{"href":"https://api.github.com/repos/graphql-rust/juniper/statuses/08849f80c34d3e69ed9a5a25e39e9835b678ed32"}},"author_association":"NONE"}}
{"actor":{"display_login":"LegNeato"}}