apollo-compiler@1.0.0-beta.7
·
245 commits
to main
since this release
Features
- Helper features for
NameandType- SimonSapin, pull/739:- The
name!macro also accepts an identifier:
name!(Query)andname!("Query")create equivalentNamevalues. InvalidNameErrornow contain a publicNodeStrfor the input string that is invalid,
and implementsDisplay,Debug, andErrortraits.- Add
TryFromconversion toNamefromNodeStr,&NodeStr,&str,String, and&String. - Add a
ty!macro to build a staticast::Typeusing GraphQL-like syntax.
- The
-
Add parsing an
ast::Typefrom a string - lrlna and goto-bus-stop, pull/718 fixing issue/715Parses GraphQL type syntax:
use apollo_compiler::ast::Type; let ty = Type::parse("[ListItem!]!")?;
Fixes
-
Fix list and null type validation bugs - goto-bus-stop, pull/746 fixing issue/738
Previous versions of apollo-compiler acceptednullinside a list even if the list item type
was marked as required. Lists were also accepted as inputs to non-list fields. This is now
fixed.input Args { string: String ints: [Int!] } type Query { example(args: Args): Int } query { example(args: { # Used to be accepted, now raises an error string: ["1"] # Used to be accepted, now raises an error ints: [1, 2, null, 4] }) }