Skip to content

Commit be1476d

Browse files
authored
Merge pull request graphql#13 from graphql/contribution-guidelines
Add contribution guide and code of conduct
2 parents ef9b361 + f0919c9 commit be1476d

File tree

7 files changed

+166
-42
lines changed

7 files changed

+166
-42
lines changed

CODE_OF_CONDUCT.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Contributor Code of Conduct
2+
3+
Please review the GraphQL Foundation Code of Conduct at
4+
https://graphql.org/codeofconduct/.

CONTRIBUTING.md

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,73 @@
11
# GraphQL Custom Scalars Specification Contribution Guide
22

3-
TODO
3+
Thanks for contributing to GraphQL Scalars.
4+
5+
The goal of the GraphQL Scalars project is to provide a directory of GraphQL
6+
Custom Scalar specifications, contributed by the community. Contributed
7+
specifications will be hosted on a GraphQL Foundation owned domain
8+
https://scalars.graphql.org, which can be referenced with the built-in
9+
`@specifiedBy` GraphQL directive.
10+
11+
GraphQL Custom Scalar specifications are language agnostic and thus can be used
12+
to document and standardize behavior across different languages.
13+
14+
We will confirm the domain details soon. We are currently setting this up.
15+
16+
Please ensure that you read the
17+
[Code of Conduct](https://graphql.org/codeofconduct/) before contributing to
18+
this project.
19+
20+
## How to contribute
21+
22+
1. Copy the `template-string.md`
23+
[template](https://github.com/graphql/graphql-scalars/blob/main/scalars/template-string.md)
24+
for Custom Scalars based on the built-in String Scalar, or otherwise use the
25+
`template.md`
26+
[template](https://github.com/graphql/graphql-scalars/blob/main/scalars/template.md)
27+
for all other Custom Scalars. Templates are located in the
28+
[graphql-scalars GitHub repository](https://github.com/graphql/graphql-scalars/tree/main/scalars).
29+
30+
2. [Open a new pull request](https://github.com/graphql/graphql-scalars/pulls)
31+
for each Custom Scalar specification you would like to add.
32+
33+
3. Modify your selected template, and save it in the correct place
34+
`scalars/contributed/<github-user-name>/<scalar-name>.md` in the
35+
[graphql-scalars GitHub repository](https://github.com/graphql/graphql-scalars/tree/main/scalars/contributed).
36+
The directory location is important, as this will form part of the reference
37+
URL for your specification.
38+
39+
### Contributor License Agreement
40+
41+
This repository is managed by EasyCLA. Project participants must sign the free
42+
[GraphQL Specification Membership agreement](https://preview-spec-membership.graphql.org)
43+
before making a contribution. You only need to do this one time, and it can be
44+
signed by
45+
[individual contributors](http://individual-spec-membership.graphql.org/) or
46+
their [employers](http://corporate-spec-membership.graphql.org/).
47+
48+
To initiate the signature process please open a PR against this repo. The
49+
EasyCLA bot will block the merge if we still need a membership agreement from
50+
you.
51+
52+
You can find
53+
[detailed information here](https://github.com/graphql/graphql-wg/tree/main/membership).
54+
If you have issues, please email
55+
56+
57+
## Review process
58+
59+
Your specification pull request will be reviewed by a maintainer of the
60+
[graphql-scalars repository](https://github.com/graphql/graphql-scalars). The
61+
maintainers will verify that the template has been completed, but note that the
62+
correctness of the specification is the responsibility of the original
63+
contributor.
64+
65+
## Immutable specifications
66+
67+
Specification semantics must not change, as specifications are publicly
68+
available reference documents. We will permit small edits which do not change
69+
specification semantics, such as typo fixes.
70+
71+
A new version of a Custom Scalar specification should have a new scalar name,
72+
such as `<scalar-name>2`, `<scalar-name>3`, or a completely different name like
73+
OffsetDateTime is different to DateTime.

scalars/contributed/andimarek/date-time.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
"Author: andimarek"
44

5-
"Date: 18.10.2022"
5+
"Date: 2022-10-18"
66

77
This is a String based Scalars (TODO: add link to explanation).
88

scalars/guide.md

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -166,30 +166,3 @@ values for logically identical values. For example a `MyLocalDate` scalar could
166166
accept the literals `"01-10-2022"` and `"01102022"` as input for the first of
167167
October 2022, but the result coercion should always return one of the possible
168168
representations.
169-
170-
## Scalars specification outline
171-
172-
A Scalars specification must clearly define the three observable aspects of a
173-
Scalar:
174-
175-
1. The possible JSON result values
176-
177-
2. The possible literal input values
178-
179-
3. The possible JSON variable input values
180-
181-
Provide positive and negative examples for each of the values.
182-
183-
The Scalar should also be given a name.
184-
185-
### Example implementation outline
186-
187-
- Background
188-
189-
- Naming recommendation
190-
191-
- Valid values
192-
193-
- Examples
194-
195-
- References

scalars/new-scalar.md

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,74 @@
1-
# Guide to contribute a new Scalar
1+
# Custom Scalar specification contribution guide
22

3-
In order to contribute a new Scalar, please open a new PR for each new Scalar.
3+
Thanks for contributing to GraphQL Scalars.
44

5-
Copy either "template.md" or "template-string.md" and modify it. The new file
6-
should be under "scalars/contributed/<your-name>/<scalar-name>.md"
5+
The goal of the GraphQL Scalars project is to provide a directory of GraphQL
6+
Custom Scalar specifications, contributed by the community. Contributed
7+
specifications will be hosted on a GraphQL Foundation owned domain
8+
https://scalars.graphql.org, which can be referenced with the built-in
9+
`@specifiedBy` GraphQL directive.
10+
11+
GraphQL Custom Scalar specifications are language agnostic and thus can be used
12+
to document and standardize behavior across different languages.
13+
14+
The scalars will be hosted at https://scalars.graphql.org. We are currently
15+
setting this up.
16+
17+
Please ensure that you read the
18+
[Code of Conduct](https://graphql.org/codeofconduct/) before contributing to
19+
this project.
20+
21+
## How to contribute
22+
23+
1. Copy the `template-string.md`
24+
[template](https://github.com/graphql/graphql-scalars/blob/main/scalars/template-string.md)
25+
for Custom Scalars based on the built-in String Scalar, or otherwise use the
26+
`template.md`
27+
[template](https://github.com/graphql/graphql-scalars/blob/main/scalars/template.md)
28+
for all other Custom Scalars. Templates are located in the
29+
[graphql-scalars GitHub repository](https://github.com/graphql/graphql-scalars/tree/main/scalars).
30+
31+
2. [Open a new pull request](https://github.com/graphql/graphql-scalars/pulls)
32+
for each Custom Scalar specification you would like to add.
33+
34+
3. Modify your selected template, and save it in the correct place
35+
`scalars/contributed/<github-user-name>/<scalar-name>.md` in the
36+
[graphql-scalars GitHub repository](https://github.com/graphql/graphql-scalars/tree/main/scalars/contributed).
37+
The directory location is important, as this will form part of the reference
38+
URL for your specification.
39+
40+
### Contributor License Agreement
41+
42+
This repository is managed by EasyCLA. Project participants must sign the free
43+
[GraphQL Specification Membership agreement](https://preview-spec-membership.graphql.org)
44+
before making a contribution. You only need to do this one time, and it can be
45+
signed by
46+
[individual contributors](http://individual-spec-membership.graphql.org/) or
47+
their [employers](http://corporate-spec-membership.graphql.org/).
48+
49+
To initiate the signature process please open a PR against this repo. The
50+
EasyCLA bot will block the merge if we still need a membership agreement from
51+
you.
52+
53+
You can find
54+
[detailed information here](https://github.com/graphql/graphql-wg/tree/main/membership).
55+
If you have issues, please email
56+
57+
58+
## Review process
59+
60+
Your specification pull request will be reviewed by a maintainer of the
61+
[graphql-scalars repository](https://github.com/graphql/graphql-scalars). The
62+
maintainers will verify that the template has been completed, but note that the
63+
correctness of the specification is the responsibility of the original
64+
contributor.
65+
66+
## Immutable specifications
67+
68+
Specification semantics must not change, as specifications are publicly
69+
available reference documents. We will permit small edits which do not change
70+
specification semantics, such as typo fixes.
71+
72+
A new version of a Custom Scalar specification should have a new scalar name,
73+
such as `<scalar-name>2`, `<scalar-name>3`, or a completely different name like
74+
OffsetDateTime is different to DateTime.

scalars/template-string.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
# This template is meant to be copied and modified
2-
3-
# This template is meant for Scalars which are based on the build in String Scalar
1+
# This template is meant to be copied and modified. This template is meant for Scalars which are based on the built-in String Scalar
42

53
# Custom Scalar spec \<name\>
64

75
"Author:\<github user name\> "
86

9-
"Date: \<the date of the first publication\>"
7+
"Date: \<the date of the first publication in YYYY-MM-DD format\>"
108

119
# Overview
1210

13-
Provide an overview what this Scalar does and which
11+
Provide an overview of what this Scalar does and provide any background
12+
information.
1413

1514
# Name
1615

17-
Talk about the name and list alternatives, if available.
16+
Provide a recommended Scalar name and list alternatives, if available.
1817

1918
# Result spec
2019

2120
Define which Strings can be returned.
2221

22+
Provide positive and negative examples of String return values.
23+
2324
# Input spec
2425

2526
Define which String values are accepted as input as GraphQL Literal and as JSON
2627
raw input.
2728

29+
Provide positive and negative examples of literal and JSON raw input values.
30+
2831
# References
2932

3033
List external references, other background information etc.

scalars/template.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,35 @@
44

55
"Author:\<github user name\> "
66

7-
"Date: \<the date of the first publication\>"
7+
"Date: \<the date of the first publication in YYYY-MM-DD format\>"
88

99
# Overview
1010

11-
Provide an overview what this Scalar does and provide any background
11+
Provide an overview of what this Scalar does and provide any background
1212
information.
1313

1414
# Name
1515

16-
Talk about the name and list alternatives, if available.
16+
Provide a recommended Scalar name and list alternatives, if available.
1717

1818
# Result JSON spec
1919

2020
Define which JSON values can be returned.
2121

22+
Provide positive and negative examples of JSON values.
23+
2224
# Literal Input spec
2325

2426
Define which GraphQL Literals are accepted as input.
2527

28+
Provide positive and negative examples of literals.
29+
2630
# Raw Input JSON spec
2731

2832
Define which JSON values are accepted as input.
2933

34+
Provide positive and negative examples of JSON values.
35+
3036
# References
3137

3238
List external references, other background information etc.

0 commit comments

Comments
 (0)