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

Allow omitting Directive arguments that are non-null if they have defaults #270

Merged
merged 1 commit into from
Jul 15, 2023

Conversation

StevenACoffman
Copy link
Collaborator

@StevenACoffman StevenACoffman commented Jul 15, 2023

Allow omitting Directive arguments that are Non-null AND have defaults.

Fix #269

Follow-up to #258 : Directives should validate argument names and non-null fields.

Minimal graphql.schema and models to reproduce

type AircraftManufacturer
  @join__type(graph: AIRCRAFT, key: "uuid")
{
  uuid: ID!
  name: String!
}

The directive definition of:

directive @join__type(
  graph: Graph!,
  key: FieldSet,
  extension: Boolean = false,
  resolvable: Boolean = true,
  isInterfaceObject: Boolean = false
) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR

so the argument in question (extension) is non-nullable but has a default so still isn't required.

Signed-off-by: Steve Coffman [email protected]

@coveralls
Copy link

Coverage Status

coverage: 88.607%. remained the same when pulling c1fecac on allow_directive_arg_empty_nonnull_if_default into 4b44f9b on master.

@StevenACoffman StevenACoffman merged commit 9fb1c32 into master Jul 15, 2023
@StevenACoffman StevenACoffman deleted the allow_directive_arg_empty_nonnull_if_default branch July 15, 2023 23:56
@StevenACoffman StevenACoffman changed the title Allow ommitting Directive arguments that are non-null if they have defaults Allow omitting Directive arguments that are non-null if they have defaults Jul 16, 2023
mergify bot referenced this pull request in infratographer/metadata-api Aug 16, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[github.com/vektah/gqlparser/v2](https://togithub.com/vektah/gqlparser)
| require | patch | `v2.5.6` -> `v2.5.8` |

---

### Release Notes

<details>
<summary>vektah/gqlparser (github.com/vektah/gqlparser/v2)</summary>

###
[`v2.5.8`](https://togithub.com/vektah/gqlparser/releases/tag/v2.5.8)

[Compare
Source](https://togithub.com/vektah/gqlparser/compare/v2.5.7...v2.5.8)

#### What's Changed

- Put comments behind an option in formatter by
[@&#8203;benjaminjkraft](https://togithub.com/benjaminjkraft) in
[https://github.com/vektah/gqlparser/pull/271](https://togithub.com/vektah/gqlparser/pull/271)

**Full Changelog**:
vektah/gqlparser@v2.5.7...v2.5.8

###
[`v2.5.7`](https://togithub.com/vektah/gqlparser/releases/tag/v2.5.7)

[Compare
Source](https://togithub.com/vektah/gqlparser/compare/v2.5.6...v2.5.7)

#### What's Changed

- \[Snyk] Security upgrade
[@&#8203;babel/preset-env](https://togithub.com/babel/preset-env) from
7.16.11 to 7.22.6 by [@&#8203;lwc](https://togithub.com/lwc) in
[https://github.com/vektah/gqlparser/pull/267](https://togithub.com/vektah/gqlparser/pull/267)
- Bump semver from 5.7.1 to 5.7.2 in /validator/imported by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/vektah/gqlparser/pull/268](https://togithub.com/vektah/gqlparser/pull/268)
- Allow ommitting Directive arguments that are non-null if they have
defaults by
[@&#8203;StevenACoffman](https://togithub.com/StevenACoffman) in
[https://github.com/vektah/gqlparser/pull/270](https://togithub.com/vektah/gqlparser/pull/270)

**Full Changelog**:
vektah/gqlparser@v2.5.6...v2.5.7

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/infratographer/metadata-api).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNDEuMyIsInVwZGF0ZWRJblZlciI6IjM2LjQzLjIiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
github-merge-queue bot referenced this pull request in infratographer/x Aug 21, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[github.com/vektah/gqlparser/v2](https://togithub.com/vektah/gqlparser)
| require | patch | `v2.5.6` -> `v2.5.8` |

---

### Release Notes

<details>
<summary>vektah/gqlparser (github.com/vektah/gqlparser/v2)</summary>

###
[`v2.5.8`](https://togithub.com/vektah/gqlparser/releases/tag/v2.5.8)

[Compare
Source](https://togithub.com/vektah/gqlparser/compare/v2.5.7...v2.5.8)

#### What's Changed

- Put comments behind an option in formatter by
[@&#8203;benjaminjkraft](https://togithub.com/benjaminjkraft) in
[https://github.com/vektah/gqlparser/pull/271](https://togithub.com/vektah/gqlparser/pull/271)

**Full Changelog**:
vektah/gqlparser@v2.5.7...v2.5.8

###
[`v2.5.7`](https://togithub.com/vektah/gqlparser/releases/tag/v2.5.7)

[Compare
Source](https://togithub.com/vektah/gqlparser/compare/v2.5.6...v2.5.7)

#### What's Changed

- \[Snyk] Security upgrade
[@&#8203;babel/preset-env](https://togithub.com/babel/preset-env) from
7.16.11 to 7.22.6 by [@&#8203;lwc](https://togithub.com/lwc) in
[https://github.com/vektah/gqlparser/pull/267](https://togithub.com/vektah/gqlparser/pull/267)
- Bump semver from 5.7.1 to 5.7.2 in /validator/imported by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/vektah/gqlparser/pull/268](https://togithub.com/vektah/gqlparser/pull/268)
- Allow ommitting Directive arguments that are non-null if they have
defaults by
[@&#8203;StevenACoffman](https://togithub.com/StevenACoffman) in
[https://github.com/vektah/gqlparser/pull/270](https://togithub.com/vektah/gqlparser/pull/270)

**Full Changelog**:
vektah/gqlparser@v2.5.6...v2.5.7

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/infratographer/x).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41LjMiLCJ1cGRhdGVkSW5WZXIiOiIzNi44LjExIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

Error parsing @join__type directive on supergraph
2 participants