Skip to content
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

apollo-compiler@1.0.0-beta.7 #750

Merged
merged 1 commit into from
Nov 17, 2023
Merged

Conversation

goto-bus-stop
Copy link
Member

@goto-bus-stop goto-bus-stop commented Nov 17, 2023

Features

  • Helper features for Name and Type - SimonSapin, pull/739:
    • The name! macro also accepts an identifier:
      name!(Query) and name!("Query") create equivalent Name values.
    • InvalidNameError now contain a public NodeStr for the input string that is invalid,
      and implements Display, Debug, and Error traits.
    • Add TryFrom conversion to Name from NodeStr, &NodeStr, &str, String, and &String.
    • Add a ty! macro to build a static ast::Type using GraphQL-like syntax.
  • Add parsing an ast::Type from a string - lrlna and goto-bus-stop, pull/718 fixing issue/715
    Parses 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 accepted null inside 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]
      })
    }

@goto-bus-stop goto-bus-stop merged commit 208d2d7 into main Nov 17, 2023
11 checks passed
@goto-bus-stop goto-bus-stop deleted the apollo-compiler@1.0.0-beta.7 branch November 17, 2023 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant