graphql / graphql/graphql-spec

positional (unnamed) arguments

Open
#411 1 comment 3 reactions 0 assignees View on GitHub
💭 Strawman (RFC 0)
Dominant language
JavaScript
Stars
14.6k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

In my experience there are many cases where it is beneficial to be able to have a directive with a single unnamed argument:

```graphql
@import("some import specification") instead of @import(defs: "some import specification")
@default("some default value") instead of @default(value: "some default value")
@calculated("some expression") instead of @calculated(expression: "some expression")
```

There are multiple ways this could be allowed ranging from a general concept of positional arguments to a narrow special case for directives with a single argument.

### Questions

1. Has positional arguments been discussed before?
2. Does anyone else have use cases that would benefit from positional arguments?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.