Refactor code to 2018 edition with 'cargo fix --edition'
This commit is contained in:
parent
178f594e58
commit
54a1b64a79
87 changed files with 613 additions and 604 deletions
|
@ -6,8 +6,8 @@ rust:
|
||||||
- nightly
|
- nightly
|
||||||
|
|
||||||
# Prevent accidentally breaking older Rust versions
|
# Prevent accidentally breaking older Rust versions
|
||||||
|
- 1.32.0
|
||||||
- 1.31.0
|
- 1.31.0
|
||||||
- 1.30.0
|
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
name = "juniper_tests"
|
name = "juniper_tests"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
publish = false
|
publish = false
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
juniper = { version = "0.11.0", path = "../../juniper" }
|
juniper = { version = "0.11.0", path = "../../juniper" }
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# master
|
# master
|
||||||
|
|
||||||
- The minimum required Rust version is now `1.30.0`.
|
- Refactored all crates to the 2018 editio [#345](https://github.com/graphql-rust/juniper/pull/345)
|
||||||
|
- The minimum required Rust version is now `1.31.0`.
|
||||||
- The `ScalarValue` custom derive has been renamed to `GraphQLScalarValue`.
|
- The `ScalarValue` custom derive has been renamed to `GraphQLScalarValue`.
|
||||||
- Added built-in support for the canonical schema introspection query via
|
- Added built-in support for the canonical schema introspection query via
|
||||||
`juniper::introspect()`. [#307](https://github.com/graphql-rust/juniper/issues/307)
|
`juniper::introspect()`. [#307](https://github.com/graphql-rust/juniper/issues/307)
|
||||||
|
|
|
@ -12,6 +12,7 @@ repository = "https://github.com/graphql-rust/juniper"
|
||||||
readme = "../README.md"
|
readme = "../README.md"
|
||||||
keywords = ["graphql", "server", "web", "rocket"]
|
keywords = ["graphql", "server", "web", "rocket"]
|
||||||
categories = ["web-programming"]
|
categories = ["web-programming"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[badges]
|
[badges]
|
||||||
travis-ci = { repository = "graphql-rust/juniper" }
|
travis-ci = { repository = "graphql-rust/juniper" }
|
||||||
|
|
|
@ -6,9 +6,9 @@ use std::vec;
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
|
||||||
use executor::Variables;
|
use crate::executor::Variables;
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use value::{DefaultScalarValue, ScalarRefValue, ScalarValue};
|
use crate::value::{DefaultScalarValue, ScalarRefValue, ScalarValue};
|
||||||
|
|
||||||
/// A type literal in the syntax tree
|
/// A type literal in the syntax tree
|
||||||
///
|
///
|
||||||
|
@ -434,7 +434,7 @@ where
|
||||||
|
|
||||||
/// Compare equality with another `InputValue` ignoring any source position information.
|
/// Compare equality with another `InputValue` ignoring any source position information.
|
||||||
pub fn unlocated_eq(&self, other: &Self) -> bool {
|
pub fn unlocated_eq(&self, other: &Self) -> bool {
|
||||||
use InputValue::*;
|
use crate::InputValue::*;
|
||||||
|
|
||||||
match (self, other) {
|
match (self, other) {
|
||||||
(&Null, &Null) => true,
|
(&Null, &Null) => true,
|
||||||
|
@ -533,7 +533,7 @@ impl<'a, S> VariableDefinitions<'a, S> {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::InputValue;
|
use super::InputValue;
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_input_value_fmt() {
|
fn test_input_value_fmt() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use ast::{Directive, Fragment, InputValue, Selection};
|
use crate::ast::{Directive, Fragment, InputValue, Selection};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use value::{ScalarRefValue, ScalarValue};
|
use crate::value::{ScalarRefValue, ScalarValue};
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
@ -388,25 +388,25 @@ impl<'a, S> LookAheadMethods<S> for LookAheadSelection<'a, S> {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use ast::Document;
|
use crate::ast::Document;
|
||||||
use parser::UnlocatedParseResult;
|
use crate::parser::UnlocatedParseResult;
|
||||||
use schema::model::SchemaType;
|
use crate::schema::model::SchemaType;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use validation::test_harness::{MutationRoot, QueryRoot};
|
use crate::validation::test_harness::{MutationRoot, QueryRoot};
|
||||||
use value::{DefaultScalarValue, ScalarRefValue, ScalarValue};
|
use crate::value::{DefaultScalarValue, ScalarRefValue, ScalarValue};
|
||||||
|
|
||||||
fn parse_document_source<S>(q: &str) -> UnlocatedParseResult<Document<S>>
|
fn parse_document_source<S>(q: &str) -> UnlocatedParseResult<Document<S>>
|
||||||
where
|
where
|
||||||
S: ScalarValue,
|
S: ScalarValue,
|
||||||
for<'b> &'b S: ScalarRefValue<'b>,
|
for<'b> &'b S: ScalarRefValue<'b>,
|
||||||
{
|
{
|
||||||
::parse_document_source(q, &SchemaType::new::<QueryRoot, MutationRoot>(&(), &()))
|
crate::parse_document_source(q, &SchemaType::new::<QueryRoot, MutationRoot>(&(), &()))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn extract_fragments<'a, S>(doc: &'a Document<S>) -> HashMap<&'a str, &'a Fragment<'a, S>> {
|
fn extract_fragments<'a, S>(doc: &'a Document<S>) -> HashMap<&'a str, &'a Fragment<'a, S>> {
|
||||||
let mut fragments = HashMap::new();
|
let mut fragments = HashMap::new();
|
||||||
for d in doc {
|
for d in doc {
|
||||||
if let ::ast::Definition::Fragment(ref f) = *d {
|
if let crate::ast::Definition::Fragment(ref f) = *d {
|
||||||
let f = &f.item;
|
let f = &f.item;
|
||||||
fragments.insert(f.name.item, f);
|
fragments.insert(f.name.item, f);
|
||||||
}
|
}
|
||||||
|
@ -429,7 +429,7 @@ query Hero {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let fragments = extract_fragments(&docs);
|
let fragments = extract_fragments(&docs);
|
||||||
|
|
||||||
if let ::ast::Definition::Operation(ref op) = docs[0] {
|
if let crate::ast::Definition::Operation(ref op) = docs[0] {
|
||||||
let vars = Variables::default();
|
let vars = Variables::default();
|
||||||
let look_ahead = LookAheadSelection::build_from_selection(
|
let look_ahead = LookAheadSelection::build_from_selection(
|
||||||
&op.item.selection_set[0],
|
&op.item.selection_set[0],
|
||||||
|
@ -483,7 +483,7 @@ query Hero {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let fragments = extract_fragments(&docs);
|
let fragments = extract_fragments(&docs);
|
||||||
|
|
||||||
if let ::ast::Definition::Operation(ref op) = docs[0] {
|
if let crate::ast::Definition::Operation(ref op) = docs[0] {
|
||||||
let vars = Variables::default();
|
let vars = Variables::default();
|
||||||
let look_ahead = LookAheadSelection::build_from_selection(
|
let look_ahead = LookAheadSelection::build_from_selection(
|
||||||
&op.item.selection_set[0],
|
&op.item.selection_set[0],
|
||||||
|
@ -541,7 +541,7 @@ query Hero {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let fragments = extract_fragments(&docs);
|
let fragments = extract_fragments(&docs);
|
||||||
|
|
||||||
if let ::ast::Definition::Operation(ref op) = docs[0] {
|
if let crate::ast::Definition::Operation(ref op) = docs[0] {
|
||||||
let vars = Variables::default();
|
let vars = Variables::default();
|
||||||
let look_ahead = LookAheadSelection::build_from_selection(
|
let look_ahead = LookAheadSelection::build_from_selection(
|
||||||
&op.item.selection_set[0],
|
&op.item.selection_set[0],
|
||||||
|
@ -623,7 +623,7 @@ query Hero {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let fragments = extract_fragments(&docs);
|
let fragments = extract_fragments(&docs);
|
||||||
|
|
||||||
if let ::ast::Definition::Operation(ref op) = docs[0] {
|
if let crate::ast::Definition::Operation(ref op) = docs[0] {
|
||||||
let vars = Variables::default();
|
let vars = Variables::default();
|
||||||
let look_ahead = LookAheadSelection::build_from_selection(
|
let look_ahead = LookAheadSelection::build_from_selection(
|
||||||
&op.item.selection_set[0],
|
&op.item.selection_set[0],
|
||||||
|
@ -683,7 +683,7 @@ query Hero($episode: Episode) {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let fragments = extract_fragments(&docs);
|
let fragments = extract_fragments(&docs);
|
||||||
|
|
||||||
if let ::ast::Definition::Operation(ref op) = docs[0] {
|
if let crate::ast::Definition::Operation(ref op) = docs[0] {
|
||||||
let mut vars = Variables::default();
|
let mut vars = Variables::default();
|
||||||
vars.insert("episode".into(), InputValue::Enum("JEDI".into()));
|
vars.insert("episode".into(), InputValue::Enum("JEDI".into()));
|
||||||
let look_ahead = LookAheadSelection::build_from_selection(
|
let look_ahead = LookAheadSelection::build_from_selection(
|
||||||
|
@ -790,7 +790,7 @@ fragment commonFields on Character {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let fragments = extract_fragments(&docs);
|
let fragments = extract_fragments(&docs);
|
||||||
|
|
||||||
if let ::ast::Definition::Operation(ref op) = docs[0] {
|
if let crate::ast::Definition::Operation(ref op) = docs[0] {
|
||||||
let vars = Variables::default();
|
let vars = Variables::default();
|
||||||
let look_ahead = LookAheadSelection::build_from_selection(
|
let look_ahead = LookAheadSelection::build_from_selection(
|
||||||
&op.item.selection_set[0],
|
&op.item.selection_set[0],
|
||||||
|
@ -854,7 +854,7 @@ query Hero {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let fragments = extract_fragments(&docs);
|
let fragments = extract_fragments(&docs);
|
||||||
|
|
||||||
if let ::ast::Definition::Operation(ref op) = docs[0] {
|
if let crate::ast::Definition::Operation(ref op) = docs[0] {
|
||||||
let vars = Variables::default();
|
let vars = Variables::default();
|
||||||
let look_ahead = LookAheadSelection::build_from_selection(
|
let look_ahead = LookAheadSelection::build_from_selection(
|
||||||
&op.item.selection_set[0],
|
&op.item.selection_set[0],
|
||||||
|
@ -912,7 +912,7 @@ query Hero {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let fragments = extract_fragments(&docs);
|
let fragments = extract_fragments(&docs);
|
||||||
|
|
||||||
if let ::ast::Definition::Operation(ref op) = docs[0] {
|
if let crate::ast::Definition::Operation(ref op) = docs[0] {
|
||||||
let vars = Variables::default();
|
let vars = Variables::default();
|
||||||
let look_ahead = LookAheadSelection::build_from_selection(
|
let look_ahead = LookAheadSelection::build_from_selection(
|
||||||
&op.item.selection_set[0],
|
&op.item.selection_set[0],
|
||||||
|
@ -986,7 +986,7 @@ fragment comparisonFields on Character {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let fragments = extract_fragments(&docs);
|
let fragments = extract_fragments(&docs);
|
||||||
|
|
||||||
if let ::ast::Definition::Operation(ref op) = docs[0] {
|
if let crate::ast::Definition::Operation(ref op) = docs[0] {
|
||||||
let mut vars = Variables::default();
|
let mut vars = Variables::default();
|
||||||
vars.insert("id".into(), InputValue::Scalar(DefaultScalarValue::Int(42)));
|
vars.insert("id".into(), InputValue::Scalar(DefaultScalarValue::Int(42)));
|
||||||
// This will normally be there
|
// This will normally be there
|
||||||
|
@ -1144,7 +1144,7 @@ query Hero {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let fragments = extract_fragments(&docs);
|
let fragments = extract_fragments(&docs);
|
||||||
|
|
||||||
if let ::ast::Definition::Operation(ref op) = docs[0] {
|
if let crate::ast::Definition::Operation(ref op) = docs[0] {
|
||||||
let vars = Variables::default();
|
let vars = Variables::default();
|
||||||
let look_ahead = LookAheadSelection::build_from_selection(
|
let look_ahead = LookAheadSelection::build_from_selection(
|
||||||
&op.item.selection_set[0],
|
&op.item.selection_set[0],
|
||||||
|
@ -1293,7 +1293,7 @@ fragment heroFriendNames on Hero {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let fragments = extract_fragments(&docs);
|
let fragments = extract_fragments(&docs);
|
||||||
|
|
||||||
if let ::ast::Definition::Operation(ref op) = docs[0] {
|
if let crate::ast::Definition::Operation(ref op) = docs[0] {
|
||||||
let vars = Variables::default();
|
let vars = Variables::default();
|
||||||
let look_ahead = LookAheadSelection::build_from_selection(
|
let look_ahead = LookAheadSelection::build_from_selection(
|
||||||
&op.item.selection_set[0],
|
&op.item.selection_set[0],
|
||||||
|
|
|
@ -6,23 +6,23 @@ use std::sync::RwLock;
|
||||||
|
|
||||||
use fnv::FnvHashMap;
|
use fnv::FnvHashMap;
|
||||||
|
|
||||||
use ast::{
|
use crate::ast::{
|
||||||
Definition, Document, Fragment, FromInputValue, InputValue, OperationType, Selection,
|
Definition, Document, Fragment, FromInputValue, InputValue, OperationType, Selection,
|
||||||
ToInputValue, Type,
|
ToInputValue, Type,
|
||||||
};
|
};
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use value::Value;
|
use crate::value::Value;
|
||||||
use GraphQLError;
|
use crate::GraphQLError;
|
||||||
|
|
||||||
use schema::meta::{
|
use crate::schema::meta::{
|
||||||
Argument, DeprecationStatus, EnumMeta, EnumValue, Field, InputObjectMeta, InterfaceMeta,
|
Argument, DeprecationStatus, EnumMeta, EnumValue, Field, InputObjectMeta, InterfaceMeta,
|
||||||
ListMeta, MetaType, NullableMeta, ObjectMeta, PlaceholderMeta, ScalarMeta, UnionMeta,
|
ListMeta, MetaType, NullableMeta, ObjectMeta, PlaceholderMeta, ScalarMeta, UnionMeta,
|
||||||
};
|
};
|
||||||
use schema::model::{RootNode, SchemaType, TypeType};
|
use crate::schema::model::{RootNode, SchemaType, TypeType};
|
||||||
|
|
||||||
use types::base::GraphQLType;
|
use crate::types::base::GraphQLType;
|
||||||
use types::name::Name;
|
use crate::types::name::Name;
|
||||||
use value::{DefaultScalarValue, ParseScalarValue, ScalarRefValue, ScalarValue};
|
use crate::value::{DefaultScalarValue, ParseScalarValue, ScalarRefValue, ScalarValue};
|
||||||
|
|
||||||
mod look_ahead;
|
mod look_ahead;
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ pub struct FieldError<S = DefaultScalarValue> {
|
||||||
|
|
||||||
impl<T: Display, S> From<T> for FieldError<S>
|
impl<T: Display, S> From<T> for FieldError<S>
|
||||||
where
|
where
|
||||||
S: ::value::ScalarValue,
|
S: crate::value::ScalarValue,
|
||||||
{
|
{
|
||||||
fn from(e: T) -> FieldError<S> {
|
fn from(e: T) -> FieldError<S> {
|
||||||
FieldError {
|
FieldError {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use executor::Variables;
|
use crate::executor::Variables;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::{DefaultScalarValue, Object, Value};
|
use crate::value::{DefaultScalarValue, Object, Value};
|
||||||
|
|
||||||
struct TestType;
|
struct TestType;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ where
|
||||||
{
|
{
|
||||||
let schema = RootNode::new(TestType, EmptyMutation::<()>::new());
|
let schema = RootNode::new(TestType, EmptyMutation::<()>::new());
|
||||||
|
|
||||||
let (result, errs) = ::execute(query, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(query, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use ast::InputValue;
|
use crate::ast::InputValue;
|
||||||
use executor::Variables;
|
use crate::executor::Variables;
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use validation::RuleError;
|
use crate::validation::RuleError;
|
||||||
use value::{DefaultScalarValue, Object, Value};
|
use crate::value::{DefaultScalarValue, Object, Value};
|
||||||
use GraphQLError::ValidationError;
|
use crate::GraphQLError::ValidationError;
|
||||||
|
|
||||||
#[derive(GraphQLEnumInternal, Debug)]
|
#[derive(GraphQLEnumInternal, Debug)]
|
||||||
enum Color {
|
enum Color {
|
||||||
|
@ -31,7 +31,7 @@ where
|
||||||
{
|
{
|
||||||
let schema = RootNode::new(TestType, EmptyMutation::<()>::new());
|
let schema = RootNode::new(TestType, EmptyMutation::<()>::new());
|
||||||
|
|
||||||
let (result, errs) = ::execute(query, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(query, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ fn does_not_accept_string_literals() {
|
||||||
let query = r#"{ toString(color: "RED") }"#;
|
let query = r#"{ toString(color: "RED") }"#;
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -112,7 +112,7 @@ fn does_not_accept_incorrect_enum_name_in_variables() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -132,7 +132,7 @@ fn does_not_accept_incorrect_type_in_variables() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
mod field_execution {
|
mod field_execution {
|
||||||
use ast::InputValue;
|
use crate::ast::InputValue;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::Value;
|
use crate::value::Value;
|
||||||
|
|
||||||
struct DataType;
|
struct DataType;
|
||||||
struct DeepDataType;
|
struct DeepDataType;
|
||||||
|
@ -65,7 +65,7 @@ mod field_execution {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -132,9 +132,9 @@ mod field_execution {
|
||||||
}
|
}
|
||||||
|
|
||||||
mod merge_parallel_fragments {
|
mod merge_parallel_fragments {
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::Value;
|
use crate::value::Value;
|
||||||
|
|
||||||
struct Type;
|
struct Type;
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ mod merge_parallel_fragments {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -205,9 +205,9 @@ mod merge_parallel_fragments {
|
||||||
}
|
}
|
||||||
|
|
||||||
mod merge_parallel_inline_fragments {
|
mod merge_parallel_inline_fragments {
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::Value;
|
use crate::value::Value;
|
||||||
|
|
||||||
struct Type;
|
struct Type;
|
||||||
struct Other;
|
struct Other;
|
||||||
|
@ -258,7 +258,7 @@ mod merge_parallel_inline_fragments {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -326,10 +326,10 @@ mod merge_parallel_inline_fragments {
|
||||||
}
|
}
|
||||||
|
|
||||||
mod threads_context_correctly {
|
mod threads_context_correctly {
|
||||||
use executor::Context;
|
use crate::executor::Context;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::Value;
|
use crate::value::Value;
|
||||||
|
|
||||||
struct Schema;
|
struct Schema;
|
||||||
|
|
||||||
|
@ -350,7 +350,7 @@ mod threads_context_correctly {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(
|
let (result, errs) = crate::execute(
|
||||||
doc,
|
doc,
|
||||||
None,
|
None,
|
||||||
&schema,
|
&schema,
|
||||||
|
@ -379,11 +379,11 @@ mod threads_context_correctly {
|
||||||
mod dynamic_context_switching {
|
mod dynamic_context_switching {
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
|
||||||
use executor::{Context, ExecutionError, FieldError, FieldResult};
|
use crate::executor::{Context, ExecutionError, FieldError, FieldResult};
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::Value;
|
use crate::value::Value;
|
||||||
|
|
||||||
struct Schema;
|
struct Schema;
|
||||||
|
|
||||||
|
@ -457,7 +457,7 @@ mod dynamic_context_switching {
|
||||||
.collect(),
|
.collect(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -513,7 +513,7 @@ mod dynamic_context_switching {
|
||||||
.collect(),
|
.collect(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, vec![]);
|
assert_eq!(errs, vec![]);
|
||||||
|
|
||||||
|
@ -566,7 +566,7 @@ mod dynamic_context_switching {
|
||||||
.collect(),
|
.collect(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
errs,
|
errs,
|
||||||
|
@ -614,7 +614,7 @@ mod dynamic_context_switching {
|
||||||
.collect(),
|
.collect(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
errs,
|
errs,
|
||||||
|
@ -674,7 +674,7 @@ mod dynamic_context_switching {
|
||||||
.collect(),
|
.collect(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -699,11 +699,11 @@ mod dynamic_context_switching {
|
||||||
}
|
}
|
||||||
|
|
||||||
mod propagates_errors_to_nullable_fields {
|
mod propagates_errors_to_nullable_fields {
|
||||||
use executor::{ExecutionError, FieldError, FieldResult, IntoFieldError};
|
use crate::executor::{ExecutionError, FieldError, FieldResult, IntoFieldError};
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::{ScalarValue, Value};
|
use crate::value::{ScalarValue, Value};
|
||||||
|
|
||||||
struct Schema;
|
struct Schema;
|
||||||
struct Inner;
|
struct Inner;
|
||||||
|
@ -749,7 +749,7 @@ mod propagates_errors_to_nullable_fields {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
println!("Result: {:#?}", result);
|
println!("Result: {:#?}", result);
|
||||||
|
|
||||||
|
@ -775,7 +775,7 @@ mod propagates_errors_to_nullable_fields {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
println!("Result: {:#?}", result);
|
println!("Result: {:#?}", result);
|
||||||
|
|
||||||
|
@ -798,7 +798,7 @@ mod propagates_errors_to_nullable_fields {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
println!("Result: {:#?}", result);
|
println!("Result: {:#?}", result);
|
||||||
|
|
||||||
|
@ -821,7 +821,7 @@ mod propagates_errors_to_nullable_fields {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
println!("Result: {:#?}", result);
|
println!("Result: {:#?}", result);
|
||||||
|
|
||||||
|
@ -847,7 +847,7 @@ mod propagates_errors_to_nullable_fields {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
println!("Result: {:#?}", result);
|
println!("Result: {:#?}", result);
|
||||||
|
|
||||||
|
@ -870,7 +870,7 @@ mod propagates_errors_to_nullable_fields {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
println!("Result: {:#?}", result);
|
println!("Result: {:#?}", result);
|
||||||
|
|
||||||
|
@ -896,7 +896,7 @@ mod propagates_errors_to_nullable_fields {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
println!("Result: {:#?}", result);
|
println!("Result: {:#?}", result);
|
||||||
|
|
||||||
|
@ -919,7 +919,7 @@ mod propagates_errors_to_nullable_fields {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
println!("Result: {:#?}", result);
|
println!("Result: {:#?}", result);
|
||||||
|
|
||||||
|
@ -962,10 +962,10 @@ mod propagates_errors_to_nullable_fields {
|
||||||
}
|
}
|
||||||
|
|
||||||
mod named_operations {
|
mod named_operations {
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::Value;
|
use crate::value::Value;
|
||||||
use GraphQLError;
|
use crate::GraphQLError;
|
||||||
|
|
||||||
struct Schema;
|
struct Schema;
|
||||||
|
|
||||||
|
@ -980,7 +980,7 @@ mod named_operations {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -997,7 +997,7 @@ mod named_operations {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -1015,7 +1015,7 @@ mod named_operations {
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) =
|
let (result, errs) =
|
||||||
::execute(doc, Some("OtherExample"), &schema, &vars, &()).expect("Execution failed");
|
crate::execute(doc, Some("OtherExample"), &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -1032,7 +1032,7 @@ mod named_operations {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let err = ::execute(doc, None, &schema, &vars, &()).unwrap_err();
|
let err = crate::execute(doc, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(err, GraphQLError::MultipleOperationsProvided);
|
assert_eq!(err, GraphQLError::MultipleOperationsProvided);
|
||||||
}
|
}
|
||||||
|
@ -1044,7 +1044,7 @@ mod named_operations {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let err = ::execute(doc, Some("UnknownExample"), &schema, &vars, &()).unwrap_err();
|
let err = crate::execute(doc, Some("UnknownExample"), &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(err, GraphQLError::UnknownOperationName);
|
assert_eq!(err, GraphQLError::UnknownOperationName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
mod interface {
|
mod interface {
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::Value;
|
use crate::value::Value;
|
||||||
|
|
||||||
trait Pet {
|
trait Pet {
|
||||||
fn name(&self) -> &str;
|
fn name(&self) -> &str;
|
||||||
|
@ -107,7 +107,7 @@ mod interface {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -145,9 +145,9 @@ mod interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
mod union {
|
mod union {
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::Value;
|
use crate::value::Value;
|
||||||
|
|
||||||
trait Pet {
|
trait Pet {
|
||||||
fn as_dog(&self) -> Option<&Dog> {
|
fn as_dog(&self) -> Option<&Dog> {
|
||||||
|
@ -241,7 +241,7 @@ mod union {
|
||||||
|
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use executor::Variables;
|
use crate::executor::Variables;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::{DefaultScalarValue, Object, Value};
|
use crate::value::{DefaultScalarValue, Object, Value};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ where
|
||||||
let schema = RootNode::new(Root {}, EmptyMutation::<()>::new());
|
let schema = RootNode::new(Root {}, EmptyMutation::<()>::new());
|
||||||
|
|
||||||
let (result, errs) =
|
let (result, errs) =
|
||||||
::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use ast::{FromInputValue, InputValue};
|
use crate::ast::{FromInputValue, InputValue};
|
||||||
use executor::Variables;
|
use crate::executor::Variables;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::{DefaultScalarValue, Object, Value};
|
use crate::value::{DefaultScalarValue, Object, Value};
|
||||||
|
|
||||||
struct Root;
|
struct Root;
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ where
|
||||||
let schema = RootNode::new(Root {}, EmptyMutation::<()>::new());
|
let schema = RootNode::new(Root {}, EmptyMutation::<()>::new());
|
||||||
|
|
||||||
let (result, errs) =
|
let (result, errs) =
|
||||||
::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,10 @@ mod input_object;
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use self::input_object::{NamedPublic, NamedPublicWithDescription};
|
use self::input_object::{NamedPublic, NamedPublicWithDescription};
|
||||||
|
|
||||||
use executor::Variables;
|
use crate::executor::Variables;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::{ParseScalarResult, ParseScalarValue, Value};
|
use crate::value::{ParseScalarResult, ParseScalarValue, Value};
|
||||||
|
|
||||||
#[derive(GraphQLEnumInternal)]
|
#[derive(GraphQLEnumInternal)]
|
||||||
#[graphql(name = "SampleEnum")]
|
#[graphql(name = "SampleEnum")]
|
||||||
|
@ -78,7 +78,7 @@ fn test_execution() {
|
||||||
let schema = RootNode::new(Root, EmptyMutation::<()>::new());
|
let schema = RootNode::new(Root, EmptyMutation::<()>::new());
|
||||||
|
|
||||||
let (result, errs) =
|
let (result, errs) =
|
||||||
::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ fn enum_introspection() {
|
||||||
let schema = RootNode::new(Root, EmptyMutation::<()>::new());
|
let schema = RootNode::new(Root, EmptyMutation::<()>::new());
|
||||||
|
|
||||||
let (result, errs) =
|
let (result, errs) =
|
||||||
::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ fn interface_introspection() {
|
||||||
let schema = RootNode::new(Root, EmptyMutation::<()>::new());
|
let schema = RootNode::new(Root, EmptyMutation::<()>::new());
|
||||||
|
|
||||||
let (result, errs) =
|
let (result, errs) =
|
||||||
::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -378,7 +378,7 @@ fn object_introspection() {
|
||||||
let schema = RootNode::new(Root, EmptyMutation::<()>::new());
|
let schema = RootNode::new(Root, EmptyMutation::<()>::new());
|
||||||
|
|
||||||
let (result, errs) =
|
let (result, errs) =
|
||||||
::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -585,7 +585,7 @@ fn scalar_introspection() {
|
||||||
let schema = RootNode::new(Root, EmptyMutation::<()>::new());
|
let schema = RootNode::new(Root, EmptyMutation::<()>::new());
|
||||||
|
|
||||||
let (result, errs) =
|
let (result, errs) =
|
||||||
::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use ast::InputValue;
|
use crate::ast::InputValue;
|
||||||
use executor::Variables;
|
use crate::executor::Variables;
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use validation::RuleError;
|
use crate::validation::RuleError;
|
||||||
use value::{DefaultScalarValue, Object, ParseScalarResult, ParseScalarValue, Value};
|
use crate::value::{DefaultScalarValue, Object, ParseScalarResult, ParseScalarValue, Value};
|
||||||
use GraphQLError::ValidationError;
|
use crate::GraphQLError::ValidationError;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct TestComplexScalar;
|
struct TestComplexScalar;
|
||||||
|
@ -120,7 +120,7 @@ where
|
||||||
{
|
{
|
||||||
let schema = RootNode::new(TestType, EmptyMutation::<()>::new());
|
let schema = RootNode::new(TestType, EmptyMutation::<()>::new());
|
||||||
|
|
||||||
let (result, errs) = ::execute(query, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(query, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ fn variable_error_on_nested_non_null() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -291,7 +291,7 @@ fn variable_error_on_incorrect_type() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(error, ValidationError(vec![
|
assert_eq!(error, ValidationError(vec![
|
||||||
RuleError::new(
|
RuleError::new(
|
||||||
|
@ -320,7 +320,7 @@ fn variable_error_on_omit_non_null() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -351,7 +351,7 @@ fn variable_multiple_errors_with_nesting() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(error, ValidationError(vec![
|
assert_eq!(error, ValidationError(vec![
|
||||||
RuleError::new(
|
RuleError::new(
|
||||||
|
@ -386,7 +386,7 @@ fn variable_error_on_additional_field() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -488,7 +488,7 @@ fn does_not_allow_non_nullable_input_to_be_omitted_in_variable() {
|
||||||
let query = r#"query q($value: String!) { fieldWithNonNullableStringInput(input: $value) }"#;
|
let query = r#"query q($value: String!) { fieldWithNonNullableStringInput(input: $value) }"#;
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -508,7 +508,7 @@ fn does_not_allow_non_nullable_input_to_be_set_to_null_in_variable() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -615,7 +615,7 @@ fn does_not_allow_non_null_lists_to_be_null() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -718,7 +718,7 @@ fn does_not_allow_lists_of_non_null_to_contain_null() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(error, ValidationError(vec![
|
assert_eq!(error, ValidationError(vec![
|
||||||
RuleError::new(
|
RuleError::new(
|
||||||
|
@ -744,7 +744,7 @@ fn does_not_allow_non_null_lists_of_non_null_to_contain_null() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(error, ValidationError(vec![
|
assert_eq!(error, ValidationError(vec![
|
||||||
RuleError::new(
|
RuleError::new(
|
||||||
|
@ -763,7 +763,7 @@ fn does_not_allow_non_null_lists_of_non_null_to_be_null() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -805,7 +805,7 @@ fn does_not_allow_invalid_types_to_be_used_as_values() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(error, ValidationError(vec![
|
assert_eq!(error, ValidationError(vec![
|
||||||
RuleError::new(
|
RuleError::new(
|
||||||
|
@ -827,7 +827,7 @@ fn does_not_allow_unknown_types_to_be_used_as_values() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(error, ValidationError(vec![
|
assert_eq!(error, ValidationError(vec![
|
||||||
RuleError::new(
|
RuleError::new(
|
||||||
|
@ -940,7 +940,7 @@ fn does_not_allow_missing_required_field() {
|
||||||
let query = r#"{ exampleInput(arg: {a: "abc"}) }"#;
|
let query = r#"{ exampleInput(arg: {a: "abc"}) }"#;
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -958,7 +958,7 @@ fn does_not_allow_null_in_required_field() {
|
||||||
let query = r#"{ exampleInput(arg: {a: "abc", b: null}) }"#;
|
let query = r#"{ exampleInput(arg: {a: "abc", b: null}) }"#;
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -976,7 +976,7 @@ fn does_not_allow_missing_variable_for_required_field() {
|
||||||
let query = r#"query q($var: Int!) { exampleInput(arg: {b: $var}) }"#;
|
let query = r#"query q($var: Int!) { exampleInput(arg: {b: $var}) }"#;
|
||||||
let vars = vec![].into_iter().collect();
|
let vars = vec![].into_iter().collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -996,7 +996,7 @@ fn does_not_allow_null_variable_for_required_field() {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -1095,7 +1095,7 @@ mod integers {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -1115,7 +1115,7 @@ mod integers {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
@ -1171,7 +1171,7 @@ mod floats {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let error = ::execute(query, None, &schema, &vars, &()).unwrap_err();
|
let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
error,
|
error,
|
||||||
|
|
|
@ -6,10 +6,10 @@ pub mod playground;
|
||||||
use serde::de::Deserialize;
|
use serde::de::Deserialize;
|
||||||
use serde::ser::{self, Serialize, SerializeMap};
|
use serde::ser::{self, Serialize, SerializeMap};
|
||||||
|
|
||||||
use ast::InputValue;
|
use crate::ast::InputValue;
|
||||||
use executor::ExecutionError;
|
use crate::executor::ExecutionError;
|
||||||
use value::{DefaultScalarValue, ScalarRefValue, ScalarValue};
|
use crate::value::{DefaultScalarValue, ScalarRefValue, ScalarValue};
|
||||||
use {FieldError, GraphQLError, GraphQLType, RootNode, Value, Variables};
|
use crate::{FieldError, GraphQLError, GraphQLType, RootNode, Value, Variables};
|
||||||
|
|
||||||
/// The expected structure of the decoded JSON document for either POST or GET requests.
|
/// The expected structure of the decoded JSON document for either POST or GET requests.
|
||||||
///
|
///
|
||||||
|
@ -80,7 +80,7 @@ where
|
||||||
MutationT: GraphQLType<S, Context = CtxT>,
|
MutationT: GraphQLType<S, Context = CtxT>,
|
||||||
for<'b> &'b S: ScalarRefValue<'b>,
|
for<'b> &'b S: ScalarRefValue<'b>,
|
||||||
{
|
{
|
||||||
GraphQLResponse(::execute(
|
GraphQLResponse(crate::execute(
|
||||||
&self.query,
|
&self.query,
|
||||||
self.operation_name(),
|
self.operation_name(),
|
||||||
root_node,
|
root_node,
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
*/
|
*/
|
||||||
use chrono::prelude::*;
|
use chrono::prelude::*;
|
||||||
|
|
||||||
use parser::{ParseError, ScalarToken, Token};
|
use crate::parser::{ParseError, ScalarToken, Token};
|
||||||
use value::{ParseScalarResult, ParseScalarValue};
|
use crate::value::{ParseScalarResult, ParseScalarValue};
|
||||||
use Value;
|
use crate::Value;
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub static RFC3339_FORMAT: &'static str = "%Y-%m-%dT%H:%M:%S%.f%:z";
|
pub static RFC3339_FORMAT: &'static str = "%Y-%m-%dT%H:%M:%S%.f%:z";
|
||||||
|
@ -90,8 +90,8 @@ graphql_scalar!(NaiveDate where Scalar = <S>{
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/// JSON numbers (i.e. IEEE doubles) are not precise enough for nanosecond
|
// JSON numbers (i.e. IEEE doubles) are not precise enough for nanosecond
|
||||||
/// datetimes. Values will be truncated to microsecond resolution.
|
// datetimes. Values will be truncated to microsecond resolution.
|
||||||
graphql_scalar!(NaiveDateTime where Scalar = <S> {
|
graphql_scalar!(NaiveDateTime where Scalar = <S> {
|
||||||
description: "NaiveDateTime"
|
description: "NaiveDateTime"
|
||||||
|
|
||||||
|
@ -112,12 +112,12 @@ graphql_scalar!(NaiveDateTime where Scalar = <S> {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use chrono::prelude::*;
|
use chrono::prelude::*;
|
||||||
use value::DefaultScalarValue;
|
use crate::{value::DefaultScalarValue, InputValue};
|
||||||
|
|
||||||
fn datetime_fixedoffset_test(raw: &'static str) {
|
fn datetime_fixedoffset_test(raw: &'static str) {
|
||||||
let input: ::InputValue<DefaultScalarValue> = ::InputValue::scalar(raw.to_string());
|
let input: crate::InputValue<DefaultScalarValue> = InputValue::scalar(raw.to_string());
|
||||||
|
|
||||||
let parsed: DateTime<FixedOffset> = ::FromInputValue::from_input_value(&input).unwrap();
|
let parsed: DateTime<FixedOffset> = crate::FromInputValue::from_input_value(&input).unwrap();
|
||||||
let expected = DateTime::parse_from_rfc3339(raw).unwrap();
|
let expected = DateTime::parse_from_rfc3339(raw).unwrap();
|
||||||
|
|
||||||
assert_eq!(parsed, expected);
|
assert_eq!(parsed, expected);
|
||||||
|
@ -139,9 +139,9 @@ mod test {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn datetime_utc_test(raw: &'static str) {
|
fn datetime_utc_test(raw: &'static str) {
|
||||||
let input: ::InputValue<DefaultScalarValue> = ::InputValue::scalar(raw.to_string());
|
let input: crate::InputValue<DefaultScalarValue> = InputValue::scalar(raw.to_string());
|
||||||
|
|
||||||
let parsed: DateTime<Utc> = ::FromInputValue::from_input_value(&input).unwrap();
|
let parsed: DateTime<Utc> = crate::FromInputValue::from_input_value(&input).unwrap();
|
||||||
let expected = DateTime::parse_from_rfc3339(raw)
|
let expected = DateTime::parse_from_rfc3339(raw)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.with_timezone(&Utc);
|
.with_timezone(&Utc);
|
||||||
|
@ -166,13 +166,13 @@ mod test {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn naivedate_from_input_value() {
|
fn naivedate_from_input_value() {
|
||||||
let input: ::InputValue<DefaultScalarValue> =
|
let input: crate::InputValue<DefaultScalarValue> =
|
||||||
::InputValue::scalar("1996-12-19".to_string());
|
InputValue::scalar("1996-12-19".to_string());
|
||||||
let y = 1996;
|
let y = 1996;
|
||||||
let m = 12;
|
let m = 12;
|
||||||
let d = 19;
|
let d = 19;
|
||||||
|
|
||||||
let parsed: NaiveDate = ::FromInputValue::from_input_value(&input).unwrap();
|
let parsed: NaiveDate = crate::FromInputValue::from_input_value(&input).unwrap();
|
||||||
let expected = NaiveDate::from_ymd(y, m, d);
|
let expected = NaiveDate::from_ymd(y, m, d);
|
||||||
|
|
||||||
assert_eq!(parsed, expected);
|
assert_eq!(parsed, expected);
|
||||||
|
@ -185,9 +185,9 @@ mod test {
|
||||||
#[test]
|
#[test]
|
||||||
fn naivedatetime_from_input_value() {
|
fn naivedatetime_from_input_value() {
|
||||||
let raw = 1_000_000_000_f64;
|
let raw = 1_000_000_000_f64;
|
||||||
let input: ::InputValue<DefaultScalarValue> = ::InputValue::scalar(raw);
|
let input: InputValue<DefaultScalarValue> = InputValue::scalar(raw);
|
||||||
|
|
||||||
let parsed: NaiveDateTime = ::FromInputValue::from_input_value(&input).unwrap();
|
let parsed: NaiveDateTime = crate::FromInputValue::from_input_value(&input).unwrap();
|
||||||
let expected = NaiveDateTime::from_timestamp_opt(raw as i64, 0).unwrap();
|
let expected = NaiveDateTime::from_timestamp_opt(raw as i64, 0).unwrap();
|
||||||
|
|
||||||
assert_eq!(parsed, expected);
|
assert_eq!(parsed, expected);
|
||||||
|
@ -200,10 +200,10 @@ mod integration_test {
|
||||||
use chrono::prelude::*;
|
use chrono::prelude::*;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
|
||||||
use executor::Variables;
|
use crate::executor::Variables;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::Value;
|
use crate::value::Value;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_serialization() {
|
fn test_serialization() {
|
||||||
|
@ -235,7 +235,7 @@ mod integration_test {
|
||||||
let schema = RootNode::new(Root, EmptyMutation::<()>::new());
|
let schema = RootNode::new(Root, EmptyMutation::<()>::new());
|
||||||
|
|
||||||
let (result, errs) =
|
let (result, errs) =
|
||||||
::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,11 @@ use serde::{de, ser};
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
use ast::InputValue;
|
use crate::ast::InputValue;
|
||||||
use executor::ExecutionError;
|
use crate::executor::ExecutionError;
|
||||||
use parser::{ParseError, SourcePosition, Spanning};
|
use crate::parser::{ParseError, SourcePosition, Spanning};
|
||||||
use validation::RuleError;
|
use crate::validation::RuleError;
|
||||||
use {GraphQLError, Object, ScalarValue, Value};
|
use crate::{GraphQLError, Object, ScalarValue, Value};
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
struct SerializeHelper {
|
struct SerializeHelper {
|
||||||
|
@ -397,11 +397,11 @@ where
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{ExecutionError, GraphQLError};
|
use super::{ExecutionError, GraphQLError};
|
||||||
use ast::InputValue;
|
use crate::ast::InputValue;
|
||||||
use serde_json::from_str;
|
use serde_json::from_str;
|
||||||
use serde_json::to_string;
|
use serde_json::to_string;
|
||||||
use value::{DefaultScalarValue, Object};
|
use crate::value::{DefaultScalarValue, Object};
|
||||||
use {FieldError, Value};
|
use crate::{FieldError, Value};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn int() {
|
fn int() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use value::{ParseScalarResult, ParseScalarValue};
|
use crate::value::{ParseScalarResult, ParseScalarValue};
|
||||||
use Value;
|
use crate::Value;
|
||||||
|
|
||||||
graphql_scalar!(Url where Scalar = <S>{
|
graphql_scalar!(Url where Scalar = <S>{
|
||||||
description: "Url"
|
description: "Url"
|
||||||
|
@ -23,13 +23,14 @@ graphql_scalar!(Url where Scalar = <S>{
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
use crate::InputValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn url_from_input_value() {
|
fn url_from_input_value() {
|
||||||
let raw = "https://example.net/";
|
let raw = "https://example.net/";
|
||||||
let input: ::InputValue = ::InputValue::scalar(raw.to_string());
|
let input: InputValue = InputValue::scalar(raw.to_string());
|
||||||
|
|
||||||
let parsed: Url = ::FromInputValue::from_input_value(&input).unwrap();
|
let parsed: Url = crate::FromInputValue::from_input_value(&input).unwrap();
|
||||||
let url = Url::parse(raw).unwrap();
|
let url = Url::parse(raw).unwrap();
|
||||||
|
|
||||||
assert_eq!(parsed, url);
|
assert_eq!(parsed, url);
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use parser::{ParseError, ScalarToken, Token};
|
use crate::{
|
||||||
use value::ParseScalarResult;
|
parser::{ParseError, ScalarToken, Token},
|
||||||
use Value;
|
value::ParseScalarResult,
|
||||||
|
Value,
|
||||||
|
};
|
||||||
|
|
||||||
graphql_scalar!(Uuid where Scalar = <S> {
|
graphql_scalar!(Uuid where Scalar = <S> {
|
||||||
description: "Uuid"
|
description: "Uuid"
|
||||||
|
@ -28,14 +30,14 @@ graphql_scalar!(Uuid where Scalar = <S> {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
use value::DefaultScalarValue;
|
use crate::{value::DefaultScalarValue, InputValue};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn uuid_from_input_value() {
|
fn uuid_from_input_value() {
|
||||||
let raw = "123e4567-e89b-12d3-a456-426655440000";
|
let raw = "123e4567-e89b-12d3-a456-426655440000";
|
||||||
let input: ::InputValue<DefaultScalarValue> = ::InputValue::scalar(raw.to_string());
|
let input: InputValue<DefaultScalarValue> = InputValue::scalar(raw.to_string());
|
||||||
|
|
||||||
let parsed: Uuid = ::FromInputValue::from_input_value(&input).unwrap();
|
let parsed: Uuid = crate::FromInputValue::from_input_value(&input).unwrap();
|
||||||
let id = Uuid::parse_str(raw).unwrap();
|
let id = Uuid::parse_str(raw).unwrap();
|
||||||
|
|
||||||
assert_eq!(parsed, id);
|
assert_eq!(parsed, id);
|
||||||
|
|
|
@ -138,7 +138,7 @@ mod validation;
|
||||||
pub mod http;
|
pub mod http;
|
||||||
pub mod integrations;
|
pub mod integrations;
|
||||||
// TODO: remove this alias export in 0.10. (breaking change)
|
// TODO: remove this alias export in 0.10. (breaking change)
|
||||||
pub use http::graphiql;
|
pub use crate::http::graphiql;
|
||||||
|
|
||||||
#[cfg(all(test, not(feature = "expose-test-schema")))]
|
#[cfg(all(test, not(feature = "expose-test-schema")))]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
@ -149,28 +149,28 @@ pub mod tests;
|
||||||
mod executor_tests;
|
mod executor_tests;
|
||||||
|
|
||||||
// Needs to be public because macros use it.
|
// Needs to be public because macros use it.
|
||||||
pub use util::to_camel_case;
|
pub use crate::util::to_camel_case;
|
||||||
|
|
||||||
use executor::execute_validated_query;
|
use crate::executor::execute_validated_query;
|
||||||
use introspection::{INTROSPECTION_QUERY, INTROSPECTION_QUERY_WITHOUT_DESCRIPTIONS};
|
use crate::introspection::{INTROSPECTION_QUERY, INTROSPECTION_QUERY_WITHOUT_DESCRIPTIONS};
|
||||||
use parser::{parse_document_source, ParseError, Spanning};
|
use crate::parser::{parse_document_source, ParseError, Spanning};
|
||||||
use validation::{validate_input_values, visit_all_rules, ValidatorContext};
|
use crate::validation::{validate_input_values, visit_all_rules, ValidatorContext};
|
||||||
|
|
||||||
pub use ast::{FromInputValue, InputValue, Selection, ToInputValue, Type};
|
pub use crate::ast::{FromInputValue, InputValue, Selection, ToInputValue, Type};
|
||||||
pub use executor::{
|
pub use crate::executor::{
|
||||||
Applies, LookAheadArgument, LookAheadMethods, LookAheadSelection, LookAheadValue,
|
Applies, LookAheadArgument, LookAheadMethods, LookAheadSelection, LookAheadValue,
|
||||||
};
|
};
|
||||||
pub use executor::{
|
pub use crate::executor::{
|
||||||
Context, ExecutionError, ExecutionResult, Executor, FieldError, FieldResult, FromContext,
|
Context, ExecutionError, ExecutionResult, Executor, FieldError, FieldResult, FromContext,
|
||||||
IntoFieldError, IntoResolvable, Registry, Variables,
|
IntoFieldError, IntoResolvable, Registry, Variables,
|
||||||
};
|
};
|
||||||
pub use introspection::IntrospectionFormat;
|
pub use crate::introspection::IntrospectionFormat;
|
||||||
pub use schema::meta;
|
pub use crate::schema::meta;
|
||||||
pub use schema::model::RootNode;
|
pub use crate::schema::model::RootNode;
|
||||||
pub use types::base::{Arguments, GraphQLType, TypeKind};
|
pub use crate::types::base::{Arguments, GraphQLType, TypeKind};
|
||||||
pub use types::scalars::{EmptyMutation, ID};
|
pub use crate::types::scalars::{EmptyMutation, ID};
|
||||||
pub use validation::RuleError;
|
pub use crate::validation::RuleError;
|
||||||
pub use value::{
|
pub use crate::value::{
|
||||||
DefaultScalarValue, Object, ParseScalarResult, ParseScalarValue, ScalarRefValue, ScalarValue,
|
DefaultScalarValue, Object, ParseScalarResult, ParseScalarValue, ScalarRefValue, ScalarValue,
|
||||||
Value,
|
Value,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use executor::Variables;
|
use crate::executor::Variables;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::{DefaultScalarValue, Value};
|
use crate::value::{DefaultScalarValue, Value};
|
||||||
|
|
||||||
struct Root;
|
struct Root;
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ where
|
||||||
let schema = RootNode::new(Root {}, EmptyMutation::<()>::new());
|
let schema = RootNode::new(Root {}, EmptyMutation::<()>::new());
|
||||||
|
|
||||||
let (result, errs) =
|
let (result, errs) =
|
||||||
::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use ast::InputValue;
|
use crate::ast::InputValue;
|
||||||
use executor::FieldResult;
|
use crate::executor::FieldResult;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::{DefaultScalarValue, Object, Value};
|
use crate::value::{DefaultScalarValue, Object, Value};
|
||||||
|
|
||||||
struct Interface;
|
struct Interface;
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
@ -124,7 +124,7 @@ where
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
use ast::InputValue;
|
use crate::ast::InputValue;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::{DefaultScalarValue, Object, Value};
|
use crate::value::{DefaultScalarValue, Object, Value};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ where
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
use ast::InputValue;
|
use crate::ast::InputValue;
|
||||||
use executor::{Context, FieldResult};
|
use crate::executor::{Context, FieldResult};
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::{DefaultScalarValue, Object, Value};
|
use crate::value::{DefaultScalarValue, Object, Value};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ where
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let (result, errs) =
|
let (result, errs) =
|
||||||
::execute(doc, None, &schema, &vars, &InnerContext).expect("Execution failed");
|
crate::execute(doc, None, &schema, &vars, &InnerContext).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use executor::Variables;
|
use crate::executor::Variables;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::{DefaultScalarValue, Object, ParseScalarResult, ParseScalarValue, Value};
|
use crate::value::{DefaultScalarValue, Object, ParseScalarResult, ParseScalarValue, Value};
|
||||||
|
|
||||||
struct DefaultName(i32);
|
struct DefaultName(i32);
|
||||||
struct OtherOrder(i32);
|
struct OtherOrder(i32);
|
||||||
|
@ -92,7 +92,7 @@ where
|
||||||
let schema = RootNode::new(Root {}, EmptyMutation::<()>::new());
|
let schema = RootNode::new(Root {}, EmptyMutation::<()>::new());
|
||||||
|
|
||||||
let (result, errs) =
|
let (result, errs) =
|
||||||
::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
use ast::InputValue;
|
use crate::ast::InputValue;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::{DefaultScalarValue, Object, Value};
|
use crate::value::{DefaultScalarValue, Object, Value};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ where
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed");
|
||||||
|
|
||||||
assert_eq!(errs, []);
|
assert_eq!(errs, []);
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
use ast::{
|
use crate::ast::{
|
||||||
Arguments, Definition, Directive, Document, Field, Fragment, FragmentSpread, InlineFragment,
|
Arguments, Definition, Directive, Document, Field, Fragment, FragmentSpread, InlineFragment,
|
||||||
InputValue, Operation, OperationType, Selection, Type, VariableDefinition, VariableDefinitions,
|
InputValue, Operation, OperationType, Selection, Type, VariableDefinition, VariableDefinitions,
|
||||||
};
|
};
|
||||||
|
|
||||||
use parser::value::parse_value_literal;
|
use crate::parser::value::parse_value_literal;
|
||||||
use parser::{
|
use crate::parser::{
|
||||||
Lexer, OptionParseResult, ParseError, ParseResult, Parser, Spanning, Token,
|
Lexer, OptionParseResult, ParseError, ParseResult, Parser, Spanning, Token,
|
||||||
UnlocatedParseResult,
|
UnlocatedParseResult,
|
||||||
};
|
};
|
||||||
use schema::meta::{Argument, Field as MetaField};
|
use crate::schema::meta::{Argument, Field as MetaField};
|
||||||
use schema::model::SchemaType;
|
use crate::schema::model::SchemaType;
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub fn parse_document_source<'a, 'b, S>(
|
pub fn parse_document_source<'a, 'b, S>(
|
||||||
|
|
|
@ -4,7 +4,7 @@ use std::iter::{Iterator, Peekable};
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
use std::str::CharIndices;
|
use std::str::CharIndices;
|
||||||
|
|
||||||
use parser::{SourcePosition, Spanning};
|
use crate::parser::{SourcePosition, Spanning};
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
|
|
||||||
use parser::{Lexer, LexerError, Spanning, Token};
|
use crate::parser::{Lexer, LexerError, Spanning, Token};
|
||||||
|
|
||||||
/// Error while parsing a GraphQL query
|
/// Error while parsing a GraphQL query
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use ast::{
|
use crate::ast::{
|
||||||
Arguments, Definition, Document, Field, InputValue, Operation, OperationType, Selection,
|
Arguments, Definition, Document, Field, InputValue, Operation, OperationType, Selection,
|
||||||
};
|
};
|
||||||
use parser::document::parse_document_source;
|
use crate::parser::document::parse_document_source;
|
||||||
use parser::{ParseError, SourcePosition, Spanning, Token};
|
use crate::parser::{ParseError, SourcePosition, Spanning, Token};
|
||||||
use schema::model::SchemaType;
|
use crate::schema::model::SchemaType;
|
||||||
use validation::test_harness::{MutationRoot, QueryRoot};
|
use crate::validation::test_harness::{MutationRoot, QueryRoot};
|
||||||
use value::{DefaultScalarValue, ScalarRefValue, ScalarValue};
|
use crate::value::{DefaultScalarValue, ScalarRefValue, ScalarValue};
|
||||||
|
|
||||||
fn parse_document<S>(s: &str) -> Document<S>
|
fn parse_document<S>(s: &str) -> Document<S>
|
||||||
where
|
where
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use parser::{Lexer, LexerError, ScalarToken, SourcePosition, Spanning, Token};
|
use crate::parser::{Lexer, LexerError, ScalarToken, SourcePosition, Spanning, Token};
|
||||||
|
|
||||||
fn tokenize_to_vec<'a>(s: &'a str) -> Vec<Spanning<Token<'a>>> {
|
fn tokenize_to_vec<'a>(s: &'a str) -> Vec<Spanning<Token<'a>>> {
|
||||||
let mut tokens = Vec::new();
|
let mut tokens = Vec::new();
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
|
||||||
use ast::{FromInputValue, InputValue, Type};
|
use crate::ast::{FromInputValue, InputValue, Type};
|
||||||
use parser::value::parse_value_literal;
|
use crate::parser::value::parse_value_literal;
|
||||||
use parser::{Lexer, Parser, SourcePosition, Spanning};
|
use crate::parser::{Lexer, Parser, SourcePosition, Spanning};
|
||||||
use value::{DefaultScalarValue, ParseScalarValue, ScalarRefValue, ScalarValue};
|
use crate::value::{DefaultScalarValue, ParseScalarValue, ScalarRefValue, ScalarValue};
|
||||||
|
|
||||||
use schema::meta::{Argument, EnumMeta, EnumValue, InputObjectMeta, MetaType, ScalarMeta};
|
use crate::schema::meta::{Argument, EnumMeta, EnumValue, InputObjectMeta, MetaType, ScalarMeta};
|
||||||
use schema::model::SchemaType;
|
use crate::schema::model::SchemaType;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
|
|
||||||
#[derive(GraphQLEnumInternal)]
|
#[derive(GraphQLEnumInternal)]
|
||||||
enum Enum {
|
enum Enum {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use ast::InputValue;
|
use crate::ast::InputValue;
|
||||||
|
|
||||||
use parser::{ParseError, ParseResult, Parser, ScalarToken, SourcePosition, Spanning, Token};
|
use crate::parser::{ParseError, ParseResult, Parser, ScalarToken, SourcePosition, Spanning, Token};
|
||||||
use schema::meta::{InputObjectMeta, MetaType};
|
use crate::schema::meta::{InputObjectMeta, MetaType};
|
||||||
use schema::model::SchemaType;
|
use crate::schema::model::SchemaType;
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub fn parse_value_literal<'a, 'b, S>(
|
pub fn parse_value_literal<'a, 'b, S>(
|
||||||
parser: &mut Parser<'a>,
|
parser: &mut Parser<'a>,
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
use ast::{FromInputValue, InputValue, Type};
|
use crate::ast::{FromInputValue, InputValue, Type};
|
||||||
use parser::{ParseError, ScalarToken};
|
use crate::parser::{ParseError, ScalarToken};
|
||||||
use schema::model::SchemaType;
|
use crate::schema::model::SchemaType;
|
||||||
use types::base::TypeKind;
|
use crate::types::base::TypeKind;
|
||||||
use value::{DefaultScalarValue, ParseScalarValue, ScalarRefValue, ScalarValue};
|
use crate::value::{DefaultScalarValue, ParseScalarValue, ScalarRefValue, ScalarValue};
|
||||||
|
|
||||||
/// Whether an item is deprecated, with context.
|
/// Whether an item is deprecated, with context.
|
||||||
#[derive(Debug, PartialEq, Hash, Clone)]
|
#[derive(Debug, PartialEq, Hash, Clone)]
|
||||||
|
|
|
@ -2,12 +2,12 @@ use std::fmt;
|
||||||
|
|
||||||
use fnv::FnvHashMap;
|
use fnv::FnvHashMap;
|
||||||
|
|
||||||
use ast::Type;
|
use crate::ast::Type;
|
||||||
use executor::{Context, Registry};
|
use crate::executor::{Context, Registry};
|
||||||
use schema::meta::{Argument, InterfaceMeta, MetaType, ObjectMeta, PlaceholderMeta, UnionMeta};
|
use crate::schema::meta::{Argument, InterfaceMeta, MetaType, ObjectMeta, PlaceholderMeta, UnionMeta};
|
||||||
use types::base::GraphQLType;
|
use crate::types::base::GraphQLType;
|
||||||
use types::name::Name;
|
use crate::types::name::Name;
|
||||||
use value::{DefaultScalarValue, ScalarRefValue, ScalarValue};
|
use crate::value::{DefaultScalarValue, ScalarRefValue, ScalarValue};
|
||||||
|
|
||||||
/// Root query node of a schema
|
/// Root query node of a schema
|
||||||
///
|
///
|
||||||
|
@ -319,7 +319,7 @@ impl<'a, S> SchemaType<'a, S> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_subtype<'b>(&self, sub_type: &Type<'b>, super_type: &Type<'b>) -> bool {
|
pub fn is_subtype<'b>(&self, sub_type: &Type<'b>, super_type: &Type<'b>) -> bool {
|
||||||
use ast::Type::*;
|
use crate::ast::Type::*;
|
||||||
|
|
||||||
if super_type == sub_type {
|
if super_type == sub_type {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
use ast::Selection;
|
use crate::ast::Selection;
|
||||||
use executor::{ExecutionResult, Executor, Registry};
|
use crate::executor::{ExecutionResult, Executor, Registry};
|
||||||
use types::base::{Arguments, GraphQLType, TypeKind};
|
use crate::types::base::{Arguments, GraphQLType, TypeKind};
|
||||||
use value::{ScalarRefValue, ScalarValue, Value};
|
use crate::value::{ScalarRefValue, ScalarValue, Value};
|
||||||
|
|
||||||
use schema::meta::{
|
use crate::schema::meta::{
|
||||||
Argument, EnumMeta, EnumValue, Field, InputObjectMeta, InterfaceMeta, MetaType, ObjectMeta,
|
Argument, EnumMeta, EnumValue, Field, InputObjectMeta, InterfaceMeta, MetaType, ObjectMeta,
|
||||||
UnionMeta,
|
UnionMeta,
|
||||||
};
|
};
|
||||||
use schema::model::{DirectiveLocation, DirectiveType, RootNode, SchemaType, TypeType};
|
use crate::schema::model::{DirectiveLocation, DirectiveType, RootNode, SchemaType, TypeType};
|
||||||
|
|
||||||
impl<'a, CtxT, S, QueryT, MutationT> GraphQLType<S> for RootNode<'a, QueryT, MutationT, S>
|
impl<'a, CtxT, S, QueryT, MutationT> GraphQLType<S> for RootNode<'a, QueryT, MutationT, S>
|
||||||
where
|
where
|
||||||
|
@ -58,8 +58,8 @@ where
|
||||||
selection_set: Option<&[Selection<S>]>,
|
selection_set: Option<&[Selection<S>]>,
|
||||||
executor: &Executor<Self::Context, S>,
|
executor: &Executor<Self::Context, S>,
|
||||||
) -> Value<S> {
|
) -> Value<S> {
|
||||||
use types::base::resolve_selection_set_into;
|
use crate::types::base::resolve_selection_set_into;
|
||||||
use value::Object;
|
use crate::value::Object;
|
||||||
if let Some(selection_set) = selection_set {
|
if let Some(selection_set) = selection_set {
|
||||||
let mut result = Object::with_capacity(selection_set.len());
|
let mut result = Object::with_capacity(selection_set.len());
|
||||||
if resolve_selection_set_into(self, info, selection_set, executor, &mut result) {
|
if resolve_selection_set_into(self, info, selection_set, executor, &mut result) {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
use super::schema_introspection::*;
|
use super::schema_introspection::*;
|
||||||
use executor::Variables;
|
use crate::executor::Variables;
|
||||||
use introspection::IntrospectionFormat;
|
use crate::introspection::IntrospectionFormat;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use tests::model::Database;
|
use crate::tests::model::Database;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_introspection_query_type_name() {
|
fn test_introspection_query_type_name() {
|
||||||
|
@ -21,7 +21,7 @@ fn test_introspection_query_type_name() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
graphql_value!({
|
graphql_value!({
|
||||||
"__schema": {
|
"__schema": {
|
||||||
|
@ -48,7 +48,7 @@ fn test_introspection_type_name() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
graphql_value!({
|
graphql_value!({
|
||||||
"__type": {
|
"__type": {
|
||||||
|
@ -74,7 +74,7 @@ fn test_introspection_specific_object_type_name_and_kind() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
graphql_value!({
|
graphql_value!({
|
||||||
"__type": {
|
"__type": {
|
||||||
|
@ -101,7 +101,7 @@ fn test_introspection_specific_interface_type_name_and_kind() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
graphql_value!({
|
graphql_value!({
|
||||||
"__type": {
|
"__type": {
|
||||||
|
@ -128,7 +128,7 @@ fn test_introspection_documentation() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
graphql_value!({
|
graphql_value!({
|
||||||
"__type": {
|
"__type": {
|
||||||
|
@ -201,7 +201,7 @@ fn test_introspection_possible_types() {
|
||||||
let database = Database::new();
|
let database = Database::new();
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
let result = ::execute(doc, None, &schema, &Variables::new(), &database);
|
let result = crate::execute(doc, None, &schema, &Variables::new(), &database);
|
||||||
|
|
||||||
let (result, errors) = result.ok().expect("Query returned error");
|
let (result, errors) = result.ok().expect("Query returned error");
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use ast::InputValue;
|
use crate::ast::InputValue;
|
||||||
use executor::Variables;
|
use crate::executor::Variables;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use tests::model::Database;
|
use crate::tests::model::Database;
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::Value;
|
use crate::value::Value;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_hero_name() {
|
fn test_hero_name() {
|
||||||
|
@ -17,7 +17,7 @@ fn test_hero_name() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![(
|
vec![(
|
||||||
|
@ -45,7 +45,7 @@ fn test_hero_field_order() {
|
||||||
}
|
}
|
||||||
}"#;
|
}"#;
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![(
|
vec![(
|
||||||
|
@ -74,7 +74,7 @@ fn test_hero_field_order() {
|
||||||
}
|
}
|
||||||
}"#;
|
}"#;
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc_reversed, None, &schema, &Variables::new(), &database),
|
crate::execute(doc_reversed, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![(
|
vec![(
|
||||||
|
@ -112,7 +112,7 @@ fn test_hero_name_and_friends() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![(
|
vec![(
|
||||||
|
@ -174,7 +174,7 @@ fn test_hero_name_and_friends_and_friends_of_friends() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![(
|
vec![(
|
||||||
|
@ -335,7 +335,7 @@ fn test_query_name() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![(
|
vec![(
|
||||||
|
@ -361,7 +361,7 @@ fn test_query_alias_single() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![(
|
vec![(
|
||||||
|
@ -391,7 +391,7 @@ fn test_query_alias_multiple() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![
|
vec![
|
||||||
|
@ -436,7 +436,7 @@ fn test_query_alias_multiple_with_fragment() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![
|
vec![
|
||||||
|
@ -482,7 +482,7 @@ fn test_query_name_variable() {
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &vars, &database),
|
crate::execute(doc, None, &schema, &vars, &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![(
|
vec![(
|
||||||
|
@ -512,7 +512,7 @@ fn test_query_name_invalid_variable() {
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &vars, &database),
|
crate::execute(doc, None, &schema, &vars, &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(vec![("human", Value::null())].into_iter().collect()),
|
Value::object(vec![("human", Value::null())].into_iter().collect()),
|
||||||
vec![]
|
vec![]
|
||||||
|
@ -527,7 +527,7 @@ fn test_query_friends_names() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![(
|
vec![(
|
||||||
|
@ -584,7 +584,7 @@ fn test_query_inline_fragments_droid() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![(
|
vec![(
|
||||||
|
@ -621,7 +621,7 @@ fn test_query_inline_fragments_human() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![(
|
vec![(
|
||||||
|
@ -655,7 +655,7 @@ fn test_object_typename() {
|
||||||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
let schema = RootNode::new(&database, EmptyMutation::<Database>::new());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &database),
|
crate::execute(doc, None, &schema, &Variables::new(), &database),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![(
|
vec![(
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use executor::Context;
|
use crate::executor::Context;
|
||||||
use tests::model::{Character, Database, Droid, Episode, Human};
|
use crate::tests::model::{Character, Database, Droid, Episode, Human};
|
||||||
|
|
||||||
impl Context for Database {}
|
impl Context for Database {}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
|
||||||
use executor::{ExecutionResult, Executor, Registry, Variables};
|
use crate::executor::{ExecutionResult, Executor, Registry, Variables};
|
||||||
use schema::meta::MetaType;
|
use crate::schema::meta::MetaType;
|
||||||
use schema::model::RootNode;
|
use crate::schema::model::RootNode;
|
||||||
use types::base::{Arguments, GraphQLType};
|
use crate::types::base::{Arguments, GraphQLType};
|
||||||
use types::scalars::EmptyMutation;
|
use crate::types::scalars::EmptyMutation;
|
||||||
use value::{ScalarRefValue, ScalarValue, Value};
|
use crate::value::{ScalarRefValue, ScalarValue, Value};
|
||||||
|
|
||||||
pub struct NodeTypeInfo {
|
pub struct NodeTypeInfo {
|
||||||
name: String,
|
name: String,
|
||||||
|
@ -75,7 +75,7 @@ fn test_node() {
|
||||||
let schema: RootNode<_, _> = RootNode::new_with_info(node, EmptyMutation::new(), node_info, ());
|
let schema: RootNode<_, _> = RootNode::new_with_info(node, EmptyMutation::new(), node_info, ());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
::execute(doc, None, &schema, &Variables::new(), &()),
|
crate::execute(doc, None, &schema, &Variables::new(), &()),
|
||||||
Ok((
|
Ok((
|
||||||
Value::object(
|
Value::object(
|
||||||
vec![
|
vec![
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
|
||||||
use ast::{Directive, FromInputValue, InputValue, Selection};
|
use crate::ast::{Directive, FromInputValue, InputValue, Selection};
|
||||||
use executor::Variables;
|
use crate::executor::Variables;
|
||||||
use value::{DefaultScalarValue, Object, ScalarRefValue, ScalarValue, Value};
|
use crate::value::{DefaultScalarValue, Object, ScalarRefValue, ScalarValue, Value};
|
||||||
|
|
||||||
use executor::{ExecutionResult, Executor, Registry};
|
use crate::executor::{ExecutionResult, Executor, Registry};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use schema::meta::{Argument, MetaType};
|
use crate::schema::meta::{Argument, MetaType};
|
||||||
|
|
||||||
/// GraphQL type kind
|
/// GraphQL type kind
|
||||||
///
|
///
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use ast::{FromInputValue, InputValue, Selection, ToInputValue};
|
use crate::ast::{FromInputValue, InputValue, Selection, ToInputValue};
|
||||||
use schema::meta::MetaType;
|
use crate::schema::meta::MetaType;
|
||||||
use value::{ScalarRefValue, ScalarValue, Value};
|
use crate::value::{ScalarRefValue, ScalarValue, Value};
|
||||||
|
|
||||||
use executor::{Executor, Registry};
|
use crate::executor::{Executor, Registry};
|
||||||
use types::base::GraphQLType;
|
use crate::types::base::GraphQLType;
|
||||||
|
|
||||||
impl<S, T, CtxT> GraphQLType<S> for Option<T>
|
impl<S, T, CtxT> GraphQLType<S> for Option<T>
|
||||||
where
|
where
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use ast::{FromInputValue, InputValue, Selection, ToInputValue};
|
use crate::ast::{FromInputValue, InputValue, Selection, ToInputValue};
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use executor::{ExecutionResult, Executor, Registry};
|
use crate::executor::{ExecutionResult, Executor, Registry};
|
||||||
use schema::meta::MetaType;
|
use crate::schema::meta::MetaType;
|
||||||
use types::base::{Arguments, GraphQLType};
|
use crate::types::base::{Arguments, GraphQLType};
|
||||||
use value::{ScalarRefValue, ScalarValue, Value};
|
use crate::value::{ScalarRefValue, ScalarValue, Value};
|
||||||
|
|
||||||
impl<S, T, CtxT> GraphQLType<S> for Box<T>
|
impl<S, T, CtxT> GraphQLType<S> for Box<T>
|
||||||
where
|
where
|
||||||
|
|
|
@ -4,12 +4,12 @@ use std::marker::PhantomData;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::{char, u32};
|
use std::{char, u32};
|
||||||
|
|
||||||
use ast::{FromInputValue, InputValue, Selection, ToInputValue};
|
use crate::ast::{FromInputValue, InputValue, Selection, ToInputValue};
|
||||||
use executor::{Executor, Registry};
|
use crate::executor::{Executor, Registry};
|
||||||
use parser::{LexerError, ParseError, ScalarToken, Token};
|
use crate::parser::{LexerError, ParseError, ScalarToken, Token};
|
||||||
use schema::meta::MetaType;
|
use crate::schema::meta::MetaType;
|
||||||
use types::base::GraphQLType;
|
use crate::types::base::GraphQLType;
|
||||||
use value::{ParseScalarResult, ParseScalarValue, ScalarRefValue, ScalarValue, Value};
|
use crate::value::{ParseScalarResult, ParseScalarValue, ScalarRefValue, ScalarValue, Value};
|
||||||
|
|
||||||
/// An ID as defined by the GraphQL specification
|
/// An ID as defined by the GraphQL specification
|
||||||
///
|
///
|
||||||
|
@ -355,8 +355,8 @@ where
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::ID;
|
use super::ID;
|
||||||
use parser::ScalarToken;
|
use crate::parser::ScalarToken;
|
||||||
use value::{DefaultScalarValue, ParseScalarValue};
|
use crate::value::{DefaultScalarValue, ParseScalarValue};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_id_from_string() {
|
fn test_id_from_string() {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use ast::InputValue;
|
use crate::ast::InputValue;
|
||||||
use schema::meta::{EnumMeta, InputObjectMeta, MetaType};
|
use crate::schema::meta::{EnumMeta, InputObjectMeta, MetaType};
|
||||||
use schema::model::{SchemaType, TypeType};
|
use crate::schema::model::{SchemaType, TypeType};
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub fn is_valid_literal_value<S>(
|
pub fn is_valid_literal_value<S>(
|
||||||
schema: &SchemaType<S>,
|
schema: &SchemaType<S>,
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
||||||
use ast::{Definition, Document, Type};
|
use crate::ast::{Definition, Document, Type};
|
||||||
|
|
||||||
use schema::meta::MetaType;
|
use crate::schema::meta::MetaType;
|
||||||
use schema::model::SchemaType;
|
use crate::schema::model::SchemaType;
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
|
|
||||||
/// Query validation error
|
/// Query validation error
|
||||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
use ast::{Definition, Document, InputValue, VariableDefinitions};
|
use crate::ast::{Definition, Document, InputValue, VariableDefinitions};
|
||||||
use executor::Variables;
|
use crate::executor::Variables;
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use schema::meta::{EnumMeta, InputObjectMeta, MetaType, ScalarMeta};
|
use crate::schema::meta::{EnumMeta, InputObjectMeta, MetaType, ScalarMeta};
|
||||||
use schema::model::{SchemaType, TypeType};
|
use crate::schema::model::{SchemaType, TypeType};
|
||||||
use validation::RuleError;
|
use crate::validation::RuleError;
|
||||||
use value::{ScalarRefValue, ScalarValue};
|
use crate::value::{ScalarRefValue, ScalarValue};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
enum Path<'a> {
|
enum Path<'a> {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
use ast::{
|
use crate::ast::{
|
||||||
Directive, Document, Field, Fragment, FragmentSpread, InlineFragment, InputValue, Operation,
|
Directive, Document, Field, Fragment, FragmentSpread, InlineFragment, InputValue, Operation,
|
||||||
Selection, VariableDefinition,
|
Selection, VariableDefinition,
|
||||||
};
|
};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub struct MultiVisitorNil;
|
pub struct MultiVisitorNil;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
use ast::{Directive, Field, InputValue};
|
use crate::ast::{Directive, Field, InputValue};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use schema::meta::Argument;
|
use crate::schema::meta::Argument;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use types::utilities::is_valid_literal_value;
|
use crate::types::utilities::is_valid_literal_value;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct ArgumentsOfCorrectType<'a, S: Debug + 'a> {
|
pub struct ArgumentsOfCorrectType<'a, S: Debug + 'a> {
|
||||||
current_args: Option<&'a Vec<Argument<'a, S>>>,
|
current_args: Option<&'a Vec<Argument<'a, S>>>,
|
||||||
|
@ -76,9 +76,9 @@ fn error_message(arg_name: &str, type_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn good_null_value() {
|
fn good_null_value() {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use ast::VariableDefinition;
|
use crate::ast::VariableDefinition;
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use types::utilities::is_valid_literal_value;
|
use crate::types::utilities::is_valid_literal_value;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct DefaultValuesOfCorrectType;
|
pub struct DefaultValuesOfCorrectType;
|
||||||
|
|
||||||
|
@ -62,9 +62,9 @@ fn non_null_error_message(arg_name: &str, type_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{factory, non_null_error_message, type_error_message};
|
use super::{factory, non_null_error_message, type_error_message};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn variables_with_no_default_values() {
|
fn variables_with_no_default_values() {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use ast::Field;
|
use crate::ast::Field;
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use schema::meta::MetaType;
|
use crate::schema::meta::MetaType;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct FieldsOnCorrectType;
|
pub struct FieldsOnCorrectType;
|
||||||
|
|
||||||
|
@ -55,9 +55,9 @@ fn error_message(field: &str, type_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn selection_on_object() {
|
fn selection_on_object() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use ast::{Fragment, InlineFragment};
|
use crate::ast::{Fragment, InlineFragment};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct FragmentsOnCompositeTypes;
|
pub struct FragmentsOnCompositeTypes;
|
||||||
|
|
||||||
|
@ -73,9 +73,9 @@ fn error_message(fragment_name: Option<&str>, on_type: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn on_object() {
|
fn on_object() {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use ast::{Directive, Field, InputValue};
|
use crate::ast::{Directive, Field, InputValue};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use schema::meta::Argument;
|
use crate::schema::meta::Argument;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
enum ArgumentPosition<'a> {
|
enum ArgumentPosition<'a> {
|
||||||
|
@ -106,9 +106,9 @@ fn directive_error_message(arg_name: &str, directive_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{directive_error_message, factory, field_error_message};
|
use super::{directive_error_message, factory, field_error_message};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn single_arg_is_known() {
|
fn single_arg_is_known() {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use ast::{Directive, Field, Fragment, FragmentSpread, InlineFragment, Operation, OperationType};
|
use crate::ast::{Directive, Field, Fragment, FragmentSpread, InlineFragment, Operation, OperationType};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use schema::model::DirectiveLocation;
|
use crate::schema::model::DirectiveLocation;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct KnownDirectives {
|
pub struct KnownDirectives {
|
||||||
location_stack: Vec<DirectiveLocation>,
|
location_stack: Vec<DirectiveLocation>,
|
||||||
|
@ -144,10 +144,10 @@ fn misplaced_error_message(directive_name: &str, location: &DirectiveLocation) -
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{factory, misplaced_error_message, unknown_error_message};
|
use super::{factory, misplaced_error_message, unknown_error_message};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use schema::model::DirectiveLocation;
|
use crate::schema::model::DirectiveLocation;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn with_no_directives() {
|
fn with_no_directives() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use ast::FragmentSpread;
|
use crate::ast::FragmentSpread;
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct KnownFragmentNames;
|
pub struct KnownFragmentNames;
|
||||||
|
|
||||||
|
@ -36,9 +36,9 @@ fn error_message(frag_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn known() {
|
fn known() {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use ast::{Fragment, InlineFragment, VariableDefinition};
|
use crate::ast::{Fragment, InlineFragment, VariableDefinition};
|
||||||
use parser::{SourcePosition, Spanning};
|
use crate::parser::{SourcePosition, Spanning};
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct KnownTypeNames;
|
pub struct KnownTypeNames;
|
||||||
|
|
||||||
|
@ -61,9 +61,9 @@ fn error_message(type_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn known_type_names_are_valid() {
|
fn known_type_names_are_valid() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use ast::{Definition, Document, Operation};
|
use crate::ast::{Definition, Document, Operation};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct LoneAnonymousOperation {
|
pub struct LoneAnonymousOperation {
|
||||||
operation_count: Option<usize>,
|
operation_count: Option<usize>,
|
||||||
|
@ -49,9 +49,9 @@ fn error_message() -> &'static str {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn no_operations() {
|
fn no_operations() {
|
||||||
|
|
|
@ -23,10 +23,10 @@ mod unique_variable_names;
|
||||||
mod variables_are_input_types;
|
mod variables_are_input_types;
|
||||||
mod variables_in_allowed_position;
|
mod variables_in_allowed_position;
|
||||||
|
|
||||||
use ast::Document;
|
use crate::ast::Document;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use validation::{visit, MultiVisitorNil, ValidatorContext};
|
use crate::validation::{visit, MultiVisitorNil, ValidatorContext};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub(crate) fn visit_all_rules<'a, S: Debug>(ctx: &mut ValidatorContext<'a, S>, doc: &'a Document<S>)
|
pub(crate) fn visit_all_rules<'a, S: Debug>(ctx: &mut ValidatorContext<'a, S>, doc: &'a Document<S>)
|
||||||
where
|
where
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
|
|
||||||
use ast::{Document, Fragment, FragmentSpread};
|
use crate::ast::{Document, Fragment, FragmentSpread};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use validation::{RuleError, ValidatorContext, Visitor};
|
use crate::validation::{RuleError, ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct NoFragmentCycles<'a> {
|
pub struct NoFragmentCycles<'a> {
|
||||||
current_fragment: Option<&'a str>,
|
current_fragment: Option<&'a str>,
|
||||||
|
@ -133,9 +133,9 @@ fn error_message(frag_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn single_reference_is_valid() {
|
fn single_reference_is_valid() {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use ast::{Document, Fragment, FragmentSpread, InputValue, Operation, VariableDefinition};
|
use crate::ast::{Document, Fragment, FragmentSpread, InputValue, Operation, VariableDefinition};
|
||||||
use parser::{SourcePosition, Spanning};
|
use crate::parser::{SourcePosition, Spanning};
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
use validation::{RuleError, ValidatorContext, Visitor};
|
use crate::validation::{RuleError, ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
pub enum Scope<'a> {
|
pub enum Scope<'a> {
|
||||||
|
@ -167,9 +167,9 @@ fn error_message(var_name: &str, op_name: Option<&str>) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn all_variables_defined() {
|
fn all_variables_defined() {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
|
|
||||||
use ast::{Definition, Document, Fragment, FragmentSpread, Operation};
|
use crate::ast::{Definition, Document, Fragment, FragmentSpread, Operation};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
pub enum Scope<'a> {
|
pub enum Scope<'a> {
|
||||||
|
@ -109,9 +109,9 @@ fn error_message(frag_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn all_fragment_names_are_used() {
|
fn all_fragment_names_are_used() {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use ast::{Document, Fragment, FragmentSpread, InputValue, Operation, VariableDefinition};
|
use crate::ast::{Document, Fragment, FragmentSpread, InputValue, Operation, VariableDefinition};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
use validation::{RuleError, ValidatorContext, Visitor};
|
use crate::validation::{RuleError, ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
pub enum Scope<'a> {
|
pub enum Scope<'a> {
|
||||||
|
@ -155,9 +155,9 @@ fn error_message(var_name: &str, op_name: Option<&str>) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn uses_all_variables() {
|
fn uses_all_variables() {
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
use ast::{Arguments, Definition, Document, Field, Fragment, FragmentSpread, Selection, Type};
|
use crate::ast::{Arguments, Definition, Document, Field, Fragment, FragmentSpread, Selection, Type};
|
||||||
use parser::{SourcePosition, Spanning};
|
use crate::parser::{SourcePosition, Spanning};
|
||||||
use schema::meta::{Field as FieldType, MetaType};
|
use crate::schema::meta::{Field as FieldType, MetaType};
|
||||||
use std::borrow::Borrow;
|
use std::borrow::Borrow;
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Conflict(ConflictReason, Vec<SourcePosition>, Vec<SourcePosition>);
|
struct Conflict(ConflictReason, Vec<SourcePosition>, Vec<SourcePosition>);
|
||||||
|
@ -740,17 +740,17 @@ mod tests {
|
||||||
use super::ConflictReasonMessage::*;
|
use super::ConflictReasonMessage::*;
|
||||||
use super::{error_message, factory, ConflictReason};
|
use super::{error_message, factory, ConflictReason};
|
||||||
|
|
||||||
use executor::Registry;
|
use crate::executor::Registry;
|
||||||
use schema::meta::MetaType;
|
use crate::schema::meta::MetaType;
|
||||||
use types::base::GraphQLType;
|
use crate::types::base::GraphQLType;
|
||||||
use types::scalars::{EmptyMutation, ID};
|
use crate::types::scalars::{EmptyMutation, ID};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{
|
use crate::validation::{
|
||||||
expect_fails_rule, expect_fails_rule_with_schema, expect_passes_rule,
|
expect_fails_rule, expect_fails_rule_with_schema, expect_passes_rule,
|
||||||
expect_passes_rule_with_schema, RuleError,
|
expect_passes_rule_with_schema, RuleError,
|
||||||
};
|
};
|
||||||
use value::{DefaultScalarValue, ScalarRefValue, ScalarValue};
|
use crate::value::{DefaultScalarValue, ScalarRefValue, ScalarValue};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unique_fields() {
|
fn unique_fields() {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
||||||
use ast::{Definition, Document, FragmentSpread, InlineFragment};
|
use crate::ast::{Definition, Document, FragmentSpread, InlineFragment};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use schema::meta::MetaType;
|
use crate::schema::meta::MetaType;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct PossibleFragmentSpreads<'a, S: Debug + 'a> {
|
pub struct PossibleFragmentSpreads<'a, S: Debug + 'a> {
|
||||||
fragment_types: HashMap<&'a str, &'a MetaType<'a, S>>,
|
fragment_types: HashMap<&'a str, &'a MetaType<'a, S>>,
|
||||||
|
@ -99,9 +99,9 @@ fn error_message(frag_name: Option<&str>, parent_type_name: &str, frag_type: &st
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn of_the_same_object() {
|
fn of_the_same_object() {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use ast::{Directive, Field};
|
use crate::ast::{Directive, Field};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use schema::meta::Field as FieldType;
|
use crate::schema::meta::Field as FieldType;
|
||||||
use schema::model::DirectiveType;
|
use crate::schema::model::DirectiveType;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct ProvidedNonNullArguments;
|
pub struct ProvidedNonNullArguments;
|
||||||
|
|
||||||
|
@ -98,9 +98,9 @@ fn directive_error_message(directive_name: &str, arg_name: &str, type_name: &str
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{directive_error_message, factory, field_error_message};
|
use super::{directive_error_message, factory, field_error_message};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn ignores_unknown_arguments() {
|
fn ignores_unknown_arguments() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use ast::Field;
|
use crate::ast::Field;
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use validation::{RuleError, ValidatorContext, Visitor};
|
use crate::validation::{RuleError, ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct ScalarLeafs;
|
pub struct ScalarLeafs;
|
||||||
|
|
||||||
|
@ -57,9 +57,9 @@ fn required_error_message(field_name: &str, type_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{factory, no_allowed_error_message, required_error_message};
|
use super::{factory, no_allowed_error_message, required_error_message};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn valid_scalar_selection() {
|
fn valid_scalar_selection() {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use std::collections::hash_map::{Entry, HashMap};
|
use std::collections::hash_map::{Entry, HashMap};
|
||||||
|
|
||||||
use ast::{Directive, Field, InputValue};
|
use crate::ast::{Directive, Field, InputValue};
|
||||||
use parser::{SourcePosition, Spanning};
|
use crate::parser::{SourcePosition, Spanning};
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct UniqueArgumentNames<'a> {
|
pub struct UniqueArgumentNames<'a> {
|
||||||
known_names: HashMap<&'a str, SourcePosition>,
|
known_names: HashMap<&'a str, SourcePosition>,
|
||||||
|
@ -54,9 +54,9 @@ fn error_message(arg_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn no_arguments_on_field() {
|
fn no_arguments_on_field() {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use std::collections::hash_map::{Entry, HashMap};
|
use std::collections::hash_map::{Entry, HashMap};
|
||||||
|
|
||||||
use ast::Fragment;
|
use crate::ast::Fragment;
|
||||||
use parser::{SourcePosition, Spanning};
|
use crate::parser::{SourcePosition, Spanning};
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct UniqueFragmentNames<'a> {
|
pub struct UniqueFragmentNames<'a> {
|
||||||
names: HashMap<&'a str, SourcePosition>,
|
names: HashMap<&'a str, SourcePosition>,
|
||||||
|
@ -46,9 +46,9 @@ fn duplicate_message(frag_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{duplicate_message, factory};
|
use super::{duplicate_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn no_fragments() {
|
fn no_fragments() {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use std::collections::hash_map::{Entry, HashMap};
|
use std::collections::hash_map::{Entry, HashMap};
|
||||||
|
|
||||||
use ast::InputValue;
|
use crate::ast::InputValue;
|
||||||
use parser::{SourcePosition, Spanning};
|
use crate::parser::{SourcePosition, Spanning};
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct UniqueInputFieldNames<'a> {
|
pub struct UniqueInputFieldNames<'a> {
|
||||||
known_name_stack: Vec<HashMap<&'a str, SourcePosition>>,
|
known_name_stack: Vec<HashMap<&'a str, SourcePosition>>,
|
||||||
|
@ -64,9 +64,9 @@ fn error_message(field_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn input_object_with_fields() {
|
fn input_object_with_fields() {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use std::collections::hash_map::{Entry, HashMap};
|
use std::collections::hash_map::{Entry, HashMap};
|
||||||
|
|
||||||
use ast::Operation;
|
use crate::ast::Operation;
|
||||||
use parser::{SourcePosition, Spanning};
|
use crate::parser::{SourcePosition, Spanning};
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct UniqueOperationNames<'a> {
|
pub struct UniqueOperationNames<'a> {
|
||||||
names: HashMap<&'a str, SourcePosition>,
|
names: HashMap<&'a str, SourcePosition>,
|
||||||
|
@ -48,9 +48,9 @@ fn error_message(op_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn no_operations() {
|
fn no_operations() {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use std::collections::hash_map::{Entry, HashMap};
|
use std::collections::hash_map::{Entry, HashMap};
|
||||||
|
|
||||||
use ast::{Operation, VariableDefinition};
|
use crate::ast::{Operation, VariableDefinition};
|
||||||
use parser::{SourcePosition, Spanning};
|
use crate::parser::{SourcePosition, Spanning};
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct UniqueVariableNames<'a> {
|
pub struct UniqueVariableNames<'a> {
|
||||||
names: HashMap<&'a str, SourcePosition>,
|
names: HashMap<&'a str, SourcePosition>,
|
||||||
|
@ -54,9 +54,9 @@ fn error_message(var_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unique_variable_names() {
|
fn unique_variable_names() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use ast::VariableDefinition;
|
use crate::ast::VariableDefinition;
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
pub struct UniqueVariableNames;
|
pub struct UniqueVariableNames;
|
||||||
|
|
||||||
|
@ -43,9 +43,9 @@ fn error_message(var_name: &str, type_name: &str) -> String {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn input_types_are_valid() {
|
fn input_types_are_valid() {
|
||||||
|
|
|
@ -2,10 +2,10 @@ use std::borrow::Cow;
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
||||||
use ast::{Document, Fragment, FragmentSpread, Operation, Type, VariableDefinition};
|
use crate::ast::{Document, Fragment, FragmentSpread, Operation, Type, VariableDefinition};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
pub enum Scope<'a> {
|
pub enum Scope<'a> {
|
||||||
|
@ -161,9 +161,9 @@ fn error_message(var_name: &str, type_name: &str, expected_type_name: &str) -> S
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{error_message, factory};
|
use super::{error_message, factory};
|
||||||
|
|
||||||
use parser::SourcePosition;
|
use crate::parser::SourcePosition;
|
||||||
use validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError};
|
||||||
use value::DefaultScalarValue;
|
use crate::value::DefaultScalarValue;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn boolean_into_boolean() {
|
fn boolean_into_boolean() {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
use ast::{FromInputValue, InputValue};
|
use crate::ast::{FromInputValue, InputValue};
|
||||||
use executor::Registry;
|
use crate::executor::Registry;
|
||||||
use parser::parse_document_source;
|
use crate::parser::parse_document_source;
|
||||||
use schema::meta::{EnumValue, MetaType};
|
use crate::schema::meta::{EnumValue, MetaType};
|
||||||
use schema::model::{DirectiveLocation, DirectiveType, RootNode};
|
use crate::schema::model::{DirectiveLocation, DirectiveType, RootNode};
|
||||||
use types::base::GraphQLType;
|
use crate::types::base::GraphQLType;
|
||||||
use types::scalars::ID;
|
use crate::types::scalars::ID;
|
||||||
use validation::{visit, MultiVisitorNil, RuleError, ValidatorContext, Visitor};
|
use crate::validation::{visit, MultiVisitorNil, RuleError, ValidatorContext, Visitor};
|
||||||
use value::{ScalarRefValue, ScalarValue};
|
use crate::value::{ScalarRefValue, ScalarValue};
|
||||||
|
|
||||||
struct Being;
|
struct Being;
|
||||||
struct Pet;
|
struct Pet;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
use ast::{
|
use crate::ast::{
|
||||||
Directive, Document, Field, Fragment, FragmentSpread, InlineFragment, InputValue, Operation,
|
Directive, Document, Field, Fragment, FragmentSpread, InlineFragment, InputValue, Operation,
|
||||||
Selection, VariableDefinition,
|
Selection, VariableDefinition,
|
||||||
};
|
};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use validation::ValidatorContext;
|
use crate::validation::ValidatorContext;
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub trait Visitor<'a, S>
|
pub trait Visitor<'a, S>
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
use ast::{
|
use crate::ast::{
|
||||||
Arguments, Definition, Directive, Document, Field, Fragment, FragmentSpread, InlineFragment,
|
Arguments, Definition, Directive, Document, Field, Fragment, FragmentSpread, InlineFragment,
|
||||||
InputValue, Operation, OperationType, Selection, Type, VariableDefinitions,
|
InputValue, Operation, OperationType, Selection, Type, VariableDefinitions,
|
||||||
};
|
};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
use schema::meta::Argument;
|
use crate::schema::meta::Argument;
|
||||||
use validation::multi_visitor::MultiVisitorCons;
|
use crate::validation::multi_visitor::MultiVisitorCons;
|
||||||
use validation::{ValidatorContext, Visitor};
|
use crate::validation::{ValidatorContext, Visitor};
|
||||||
use value::ScalarValue;
|
use crate::value::ScalarValue;
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub fn visit<'a, A, B, S>(
|
pub fn visit<'a, A, B, S>(
|
||||||
|
@ -353,7 +353,7 @@ fn enter_input_value<'a, S, V>(
|
||||||
S: ScalarValue,
|
S: ScalarValue,
|
||||||
V: Visitor<'a, S>,
|
V: Visitor<'a, S>,
|
||||||
{
|
{
|
||||||
use InputValue::*;
|
use crate::InputValue::*;
|
||||||
|
|
||||||
let start = &input_value.start;
|
let start = &input_value.start;
|
||||||
let end = &input_value.end;
|
let end = &input_value.end;
|
||||||
|
@ -376,7 +376,7 @@ fn exit_input_value<'a, S, V>(
|
||||||
S: ScalarValue,
|
S: ScalarValue,
|
||||||
V: Visitor<'a, S>,
|
V: Visitor<'a, S>,
|
||||||
{
|
{
|
||||||
use InputValue::*;
|
use crate::InputValue::*;
|
||||||
|
|
||||||
let start = &input_value.start;
|
let start = &input_value.start;
|
||||||
let end = &input_value.end;
|
let end = &input_value.end;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use ast::{InputValue, ToInputValue};
|
use crate::ast::{InputValue, ToInputValue};
|
||||||
use parser::Spanning;
|
use crate::parser::Spanning;
|
||||||
mod object;
|
mod object;
|
||||||
mod scalar;
|
mod scalar;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use parser::{ParseError, ScalarToken};
|
use crate::parser::{ParseError, ScalarToken};
|
||||||
use serde::de;
|
use serde::de;
|
||||||
use serde::ser::Serialize;
|
use serde::ser::Serialize;
|
||||||
use std::fmt::{self, Debug, Display};
|
use std::fmt::{self, Debug, Display};
|
||||||
|
|
|
@ -9,6 +9,7 @@ description = "Internal custom derive trait for Juniper GraphQL"
|
||||||
license = "BSD-2-Clause"
|
license = "BSD-2-Clause"
|
||||||
documentation = "https://docs.rs/juniper"
|
documentation = "https://docs.rs/juniper"
|
||||||
repository = "https://github.com/graphql-rust/juniper"
|
repository = "https://github.com/graphql-rust/juniper"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
use proc_macro2::TokenStream;
|
use proc_macro2::TokenStream;
|
||||||
|
|
||||||
use syn;
|
use syn::{self, Data, DeriveInput, Fields, Variant};
|
||||||
use syn::{Data, DeriveInput, Fields, Variant};
|
|
||||||
|
|
||||||
use util::*;
|
use crate::util::*;
|
||||||
|
|
||||||
#[derive(Default, Debug)]
|
#[derive(Default, Debug)]
|
||||||
struct EnumAttrs {
|
struct EnumAttrs {
|
||||||
|
@ -165,7 +164,7 @@ pub fn impl_enum(ast: &syn::DeriveInput, is_internal: bool) -> TokenStream {
|
||||||
// Build value.
|
// Build value.
|
||||||
let name = var_attrs
|
let name = var_attrs
|
||||||
.name
|
.name
|
||||||
.unwrap_or(::util::to_upper_snake_case(&variant.ident.to_string()));
|
.unwrap_or(crate::util::to_upper_snake_case(&variant.ident.to_string()));
|
||||||
let descr = match var_attrs.description {
|
let descr = match var_attrs.description {
|
||||||
Some(s) => quote! { Some(#s.to_string()) },
|
Some(s) => quote! { Some(#s.to_string()) },
|
||||||
None => quote! { None },
|
None => quote! { None },
|
||||||
|
|
|
@ -4,7 +4,7 @@ use proc_macro2::{Span, TokenStream};
|
||||||
use quote::ToTokens;
|
use quote::ToTokens;
|
||||||
use syn::{self, Data, DeriveInput, Field, Fields, Ident, Meta, NestedMeta};
|
use syn::{self, Data, DeriveInput, Field, Fields, Ident, Meta, NestedMeta};
|
||||||
|
|
||||||
use util::*;
|
use crate::util::*;
|
||||||
|
|
||||||
#[derive(Default, Debug)]
|
#[derive(Default, Debug)]
|
||||||
struct ObjAttrs {
|
struct ObjAttrs {
|
||||||
|
@ -170,7 +170,7 @@ pub fn impl_input_object(ast: &syn::DeriveInput, is_internal: bool) -> TokenStre
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
// Note: auto camel casing when no custom name specified.
|
// Note: auto camel casing when no custom name specified.
|
||||||
::util::to_camel_case(&field_ident.to_string())
|
crate::util::to_camel_case(&field_ident.to_string())
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let field_description = match field_attrs.description {
|
let field_description = match field_attrs.description {
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
use proc_macro2::{Span, TokenStream};
|
use proc_macro2::{Span, TokenStream};
|
||||||
use syn;
|
use syn::{self, Data, DeriveInput, Field, Fields, Ident};
|
||||||
use syn::{Data, DeriveInput, Field, Fields, Ident};
|
|
||||||
|
|
||||||
use util::*;
|
use crate::util::*;
|
||||||
|
|
||||||
#[derive(Default, Debug)]
|
#[derive(Default, Debug)]
|
||||||
struct ObjAttrs {
|
struct ObjAttrs {
|
||||||
|
@ -179,7 +178,7 @@ pub fn impl_object(ast: &syn::DeriveInput) -> TokenStream {
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
// Note: auto camel casing when no custom name specified.
|
// Note: auto camel casing when no custom name specified.
|
||||||
::util::to_camel_case(&field_ident.to_string())
|
crate::util::to_camel_case(&field_ident.to_string())
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let build_description = match field_attrs.description {
|
let build_description = match field_attrs.description {
|
||||||
|
|
|
@ -6,6 +6,7 @@ description = "Juniper GraphQL integration with Hyper"
|
||||||
license = "BSD-2-Clause"
|
license = "BSD-2-Clause"
|
||||||
documentation = "https://docs.rs/juniper_hyper"
|
documentation = "https://docs.rs/juniper_hyper"
|
||||||
repository = "https://github.com/graphql-rust/juniper"
|
repository = "https://github.com/graphql-rust/juniper"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
|
|
|
@ -9,6 +9,7 @@ description = "Iron integration for juniper"
|
||||||
license = "BSD-2-Clause"
|
license = "BSD-2-Clause"
|
||||||
documentation = "https://docs.rs/juniper_iron"
|
documentation = "https://docs.rs/juniper_iron"
|
||||||
repository = "https://github.com/graphql-rust/juniper"
|
repository = "https://github.com/graphql-rust/juniper"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "1.0.2" }
|
serde = { version = "1.0.2" }
|
||||||
|
|
|
@ -9,6 +9,7 @@ description = "Juniper GraphQL integration with Rocket"
|
||||||
license = "BSD-2-Clause"
|
license = "BSD-2-Clause"
|
||||||
documentation = "https://docs.rs/juniper_rocket"
|
documentation = "https://docs.rs/juniper_rocket"
|
||||||
repository = "https://github.com/graphql-rust/juniper"
|
repository = "https://github.com/graphql-rust/juniper"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "1.0.2" }
|
serde = { version = "1.0.2" }
|
||||||
|
|
|
@ -6,6 +6,7 @@ description = "Juniper GraphQL integration with Warp"
|
||||||
license = "BSD-2-Clause"
|
license = "BSD-2-Clause"
|
||||||
documentation = "https://docs.rs/juniper_warp"
|
documentation = "https://docs.rs/juniper_warp"
|
||||||
repository = "https://github.com/graphql-rust/juniper"
|
repository = "https://github.com/graphql-rust/juniper"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
warp = "0.1.8"
|
warp = "0.1.8"
|
||||||
|
|
Loading…
Reference in a new issue