Skip to content

Commit

Permalink
Fixes for CMD check
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Oct 4, 2016
1 parent 515f6a3 commit 38f1259
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Description: Bindings to the libgraphqlparser C++ library. Currently parses
License: BSD_3_clause + file LICENSE
Encoding: UTF-8
LinkingTo: Rcpp
Imports: Rcpp
Imports: Rcpp, jsonlite
LazyData: true
SystemRequirements: C++11
RoxygenNote: 5.0.1.9000
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

export(graphql2json)
importFrom(Rcpp,sourceCpp)
importFrom(jsonlite,toJSON)
useDynLib(graphql)
12 changes: 9 additions & 3 deletions R/graphql2json.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#' Dump GraphQL to JSON
#'
#' Parses GraphQL and exports as JSON
#' Parses GraphQL and exports the AST in JSON format.
#'
#' @export
#' @useDynLib graphql
#' @importFrom Rcpp sourceCpp
graphql2json <- function(string){
dump_json_ast(string)
#' @importFrom jsonlite toJSON
#' @param input a string with graphql syntax
#' @examples graphql2json("{ field(complex: { a: { b: [ $var ] } }) }")
graphql2json <- function(input){
stopifnot(is.character(input))
input <- paste(input, collapse = "\n")
json <- dump_json_ast(input)
structure(json, class = "json")
}
10 changes: 8 additions & 2 deletions man/graphql2json.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions man/hello.Rd

This file was deleted.

0 comments on commit 38f1259

Please sign in to comment.