Skip to content

Added consume_query #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,20 @@
//!
#![warn(missing_debug_implementations)]

#[cfg(test)] #[macro_use] extern crate pretty_assertions;

#[cfg(test)]
#[macro_use]
extern crate pretty_assertions;

mod common;
#[macro_use]
mod format;
mod position;
mod tokenizer;
mod helpers;
mod position;
pub mod query;
pub mod schema;
mod tokenizer;

pub use crate::query::parse_query;
pub use crate::schema::parse_schema;
pub use crate::position::Pos;
pub use crate::format::Style;
pub use crate::position::Pos;
pub use crate::query::{consume_query, parse_query};
pub use crate::schema::parse_schema;
6 changes: 3 additions & 3 deletions src/query/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
//!
//! [graphql grammar]: http://facebook.github.io/graphql/October2016/#sec-Appendix-Grammar-Summary
//!
pub use crate::common::{Directive, Number, Text, Type, Value};
use crate::position::Pos;
pub use crate::common::{Directive, Number, Value, Text, Type};

/// Root of query data
#[derive(Debug, Clone, PartialEq)]
Expand All @@ -17,9 +17,9 @@ pub struct Document<'a, T: Text<'a>> {
impl<'a> Document<'a, String> {
pub fn into_static(self) -> Document<'static, String> {
// To support both reference and owned values in the AST,
// all string data is represented with the ::common::Str<'a, T: Text<'a>>
// all string data is represented with the ::common::Str<'a, T: Text<'a>>
// wrapper type.
// This type must carry the liftetime of the query string,
// This type must carry the lifetime of the query string,
// and is stored in a PhantomData value on the Str type.
// When using owned String types, the actual lifetime of
// the Ast nodes is 'static, since no references are kept,
Expand Down
Loading