Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

[Feature Request] Ignore null arguments  #178

@thanhbinh84

Description

@thanhbinh84

Steps to reproduce:

  1. Having a script to update profile such as:
mutation UpdateProfile ($birthday: String, $deviceToken: String)  {
    updateProfile(
        birthday: $birthday,
        deviceToken: $deviceToken
    )
}
  1. Passing deviceToken value only

Expected
Generate graphql without birthday:

mutation {
    updateProfile(
        deviceToken: "abc"
    )
}

Actual
Generate graphql with null birthday:

mutation {
    updateProfile(
        deviceToken: "abc",
        birthday: null 
    )
}

Specs
Artemis version: ^6.0.4-beta.1

build.yaml:
targets:
  $default:
    sources:
      - lib/**
      - graphql/**
      - my.schema.graphql
    builders:
      artemis:
        options:
          fragments_glob: graphql/fragments/common.graphql
          schema_mapping:
            - schema: my.schema.graphql
              queries_glob: graphql/*.graphql
              output: lib/libs/graphql/graphql_api.dart
              naming_scheme: pathedWithFields
Artemis output:
# Please paste the output of
$ flutter pub run build_runner build --verbose
#or
$ pub run build_runner build --verbose

[INFO] Generating build script...
[INFO] Generating build script completed, took 415ms

[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 12.1s

[WARNING] The package `adix` does not include some required sources in any of its targets (see their build.yaml file).
The missing sources are:
  - $package$
[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 677ms

[INFO] Checking for unexpected pre-existing outputs....
[INFO] Deleting 3 declared outputs which already existed on disk.
[INFO] Checking for unexpected pre-existing outputs. completed, took 7ms

[INFO] Running build...
[INFO] Generating SDK summary...
[INFO] 4.3s elapsed, 1/17 actions completed.
[INFO] Generating SDK summary completed, took 3.7s

[INFO] 5.4s elapsed, 2/17 actions completed.
[INFO] 6.5s elapsed, 5/21 actions completed.
[INFO] 7.5s elapsed, 6/22 actions completed.
[INFO] 8.6s elapsed, 6/22 actions completed.
[INFO] 9.6s elapsed, 6/22 actions completed.
[INFO] 10.7s elapsed, 6/22 actions completed.
[INFO] 11.8s elapsed, 6/22 actions completed.
[INFO] 14.3s elapsed, 6/22 actions completed.
[INFO] 15.6s elapsed, 6/22 actions completed.
[INFO] 19.4s elapsed, 7/22 actions completed.
[INFO] 20.6s elapsed, 14/28 actions completed.
[INFO] 21.7s elapsed, 50/66 actions completed.
[INFO] 22.7s elapsed, 167/167 actions completed.
[INFO] Running build completed, took 22.8s

[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 81ms

[INFO] Succeeded after 22.8s with 4 outputs (172 actions)
GraphQL schema:
# If possible, please paste your GraphQL schema file,
# or a minimum reproducible schema of the bug.
GraphQL query:
# If possible, please paste your GraphQL query file,
# or a minimum reproducible query of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions