Skip to content

Commit 3f531e4

Browse files
authored
Merge pull request #255 from proto-graphql/izumin5210/proto3-optional
feat: support proto3 optional
2 parents 1ee44db + 0d4a8a7 commit 3f531e4

File tree

25 files changed

+640
-2
lines changed

25 files changed

+640
-2
lines changed

.changeset/weak-apes-behave.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@proto-graphql/e2e": patch
3+
"@proto-graphql/codegen-core": patch
4+
"@proto-graphql/proto-descriptors": patch
5+
"@testapis/proto": patch
6+
"protoc-gen-nexus": patch
7+
"protoc-gen-pothos": patch
8+
---
9+
10+
support proto3 optional

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
node-version: 18.x
1616
- run: yarn --frozen-lockfile
1717
- run: yarn test
18+
env:
19+
NODE_OPTIONS: "--max_old_space_size=8192"
1820
- name: Coveralls
1921
uses: coverallsapp/github-action@v1.1.2
2022
with:
@@ -38,3 +40,5 @@ jobs:
3840
- uses: bufbuild/buf-setup-action@v1
3941
- run: yarn --frozen-lockfile
4042
- run: yarn test:e2e
43+
env:
44+
NODE_OPTIONS: "--max_old_space_size=8192"

e2e/tests.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
{ "target": "nexus", "proto": { "package": "oneof", "lib": "protobufjs" } },
2323
{ "target": "nexus", "proto": { "package": "primitives", "lib": "google-protobuf" } },
2424
{ "target": "nexus", "proto": { "package": "primitives", "lib": "protobufjs" } },
25+
{ "target": "nexus", "proto": { "package": "proto3_optional", "lib": "google-protobuf" } },
26+
{ "target": "nexus", "proto": { "package": "proto3_optional", "lib": "protobufjs" } },
2527
{ "target": "nexus", "proto": { "package": "wktypes", "lib": "google-protobuf" } },
2628
{ "target": "nexus", "proto": { "package": "wktypes", "lib": "protobufjs" } },
2729
{ "target": "pothos", "proto": { "package": "deprecation", "lib": "ts-proto" } },
@@ -36,6 +38,7 @@
3638
{ "target": "pothos", "proto": { "package": "oneof", "lib": "ts-proto" } },
3739
{ "target": "pothos", "proto": { "package": "primitives", "lib": "ts-proto" } },
3840
{ "target": "pothos", "proto": { "package": "primitives", "lib": "ts-proto-with-forcelong-number" } },
41+
{ "target": "pothos", "proto": { "package": "proto3_optional", "lib": "ts-proto" } },
3942
{ "target": "pothos", "proto": { "package": "wktypes", "lib": "ts-proto" } },
4043
{ "target": "pothos", "proto": { "package": "wktypes", "lib": "ts-proto-with-forcelong-number" } }
4144
]

e2e/tests/nexus--proto3_optional--google-protobuf/__generated__/schema.graphql

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import "@proto-nexus/google-protobuf";
2+
import { Message } from "@testapis/node-native/lib/testapis/proto3_optional/proto3_optional_pb";
3+
import { queryField } from "nexus";
4+
5+
import { makeTestSchema } from "../../src/makeTestSchema";
6+
import * as types1 from "../__generated__/nexus/google-protobuf/testapis/proto3_optional/proto3_optional_pb_nexus";
7+
8+
const testQuery = queryField("test1", {
9+
type: "Message",
10+
resolve() {
11+
return new Message();
12+
},
13+
});
14+
15+
export const schema = makeTestSchema({
16+
rootDir: __dirname,
17+
types: [types1, testQuery],
18+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Code generated by setupTests.mjs. DO NOT EDIT.
2+
{
3+
"extends": "../../tsconfig.base.json",
4+
"compilerOptions": {
5+
"baseUrl": ".",
6+
"paths": {
7+
"@testapp/*": [
8+
"./*"
9+
]
10+
}
11+
},
12+
"include": [
13+
"./**/*",
14+
"../../src/**/*",
15+
"../__generated__/nexus/google-protobuf/testapis/proto3_optional/**/*"
16+
]
17+
}

e2e/tests/nexus--proto3_optional--protobufjs/__generated__/schema.graphql

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import "@proto-nexus/google-protobuf";
2+
import * as pb from "@testapis/node/lib/testapis/proto3_optional";
3+
import { queryField } from "nexus";
4+
5+
import { makeTestSchema } from "../../src/makeTestSchema";
6+
import * as types1 from "../__generated__/nexus/protobufjs/testapis/proto3_optional/proto3_optional_pb_nexus";
7+
8+
const testQuery = queryField("test1", {
9+
type: "Message",
10+
resolve() {
11+
return new pb.testapis.proto3_optional.Message();
12+
},
13+
});
14+
15+
export const schema = makeTestSchema({
16+
rootDir: __dirname,
17+
types: [types1, testQuery],
18+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Code generated by setupTests.mjs. DO NOT EDIT.
2+
{
3+
"extends": "../../tsconfig.base.json",
4+
"compilerOptions": {
5+
"baseUrl": ".",
6+
"paths": {
7+
"@testapp/*": [
8+
"./*"
9+
]
10+
}
11+
},
12+
"include": [
13+
"./**/*",
14+
"../../src/**/*",
15+
"../__generated__/nexus/protobufjs/testapis/proto3_optional/**/*"
16+
]
17+
}

e2e/tests/pothos--proto3_optional--ts-proto/__generated__/schema.graphql

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)