Skip to content

Commit

Permalink
Merge branch 'main' into tgriesser/bug/parseIdType
Browse files Browse the repository at this point in the history
  • Loading branch information
hayes committed Feb 23, 2023
2 parents 07d8df5 + 9c17ca4 commit 420e975
Show file tree
Hide file tree
Showing 49 changed files with 319 additions and 35 deletions.
10 changes: 10 additions & 0 deletions examples/complex-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @pothos-examples/complex-app

## 1.4.28

### Patch Changes

- Updated dependencies [d60cb49e]
- @pothos/plugin-relay@3.36.0
- @pothos/plugin-dataloader@3.14.0
- @pothos/plugin-prisma@3.41.0
- @pothos/plugin-scope-auth@3.18.0

## 1.4.27

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/complex-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "1.4.27",
"version": "1.4.28",
"name": "@pothos-examples/complex-app",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
7 changes: 7 additions & 0 deletions examples/envelope-helix-fastify/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @pothos-examples/envelope-helix-fastify

## 2.4.20

### Patch Changes

- Updated dependencies [42bf6190]
- @pothos/core@3.27.0

## 2.4.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/envelope-helix-fastify/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "2.4.19",
"version": "2.4.20",
"name": "@pothos-examples/envelope-helix-fastify",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
7 changes: 7 additions & 0 deletions examples/graphql-shield/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @pothos-examples/graphql-shield

## 2.2.20

### Patch Changes

- Updated dependencies [42bf6190]
- @pothos/core@3.27.0

## 2.2.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/graphql-shield/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "2.2.19",
"version": "2.2.20",
"name": "@pothos-examples/graphql-shield",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
7 changes: 7 additions & 0 deletions examples/helix/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @pothos-examples/helix

## 2.4.20

### Patch Changes

- Updated dependencies [42bf6190]
- @pothos/core@3.27.0

## 2.4.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/helix/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "2.4.19",
"version": "2.4.20",
"name": "@pothos-examples/helix",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
7 changes: 7 additions & 0 deletions examples/nextjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @pothos-examples/nextjs

## 2.6.3

### Patch Changes

- Updated dependencies [42bf6190]
- @pothos/core@3.27.0

## 2.6.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pothos-examples/nextjs",
"version": "2.6.2",
"version": "2.6.3",
"private": true,
"scripts": {
"generate": "graphql-codegen",
Expand Down
9 changes: 9 additions & 0 deletions examples/open-telemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @pothos-examples/open-telemetry

## 1.2.20

### Patch Changes

- Updated dependencies [42bf6190]
- @pothos/core@3.27.0
- @pothos/plugin-tracing@0.5.7
- @pothos/tracing-opentelemetry@0.6.8

## 1.2.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/open-telemetry/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pothos-examples/open-telemetry",
"version": "1.2.19",
"version": "1.2.20",
"main": "index.js",
"license": "MIT",
"dependencies": {
Expand Down
10 changes: 10 additions & 0 deletions examples/prisma-federation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @pothos-examples/relay

## 2.7.4

### Patch Changes

- Updated dependencies [42bf6190]
- @pothos/core@3.27.0
- @pothos/plugin-directives@3.9.2
- @pothos/plugin-federation@3.9.1
- @pothos/plugin-prisma@3.41.0

## 2.7.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/prisma-federation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "2.7.3",
"version": "2.7.4",
"name": "@pothos-examples/prisma-federation",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
8 changes: 8 additions & 0 deletions examples/prisma-relay/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @pothos-examples/prisma-relay

## 2.7.26

### Patch Changes

- Updated dependencies [d60cb49e]
- @pothos/plugin-relay@3.36.0
- @pothos/plugin-prisma@3.41.0

## 2.7.25

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/prisma-relay/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "2.7.25",
"version": "2.7.26",
"name": "@pothos-examples/prisma-relay",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
9 changes: 9 additions & 0 deletions examples/prisma-smart-subscriptions-apollo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @pothos-examples/prisma-smart-subscriptions-apollo

## 2.5.3

### Patch Changes

- Updated dependencies [42bf6190]
- @pothos/core@3.27.0
- @pothos/plugin-prisma@3.41.0
- @pothos/plugin-smart-subscriptions@3.7.0

## 2.5.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/prisma-smart-subscriptions-apollo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "2.5.2",
"version": "2.5.3",
"name": "@pothos-examples/prisma-smart-subscriptions-apollo",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
8 changes: 8 additions & 0 deletions examples/prisma-subscriptions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @pothos-examples/prisma-subscriptions

## 2.4.25

### Patch Changes

- Updated dependencies [42bf6190]
- @pothos/core@3.27.0
- @pothos/plugin-prisma@3.41.0

## 2.4.24

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/prisma-subscriptions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "2.4.24",
"version": "2.4.25",
"name": "@pothos-examples/prisma-subscriptions",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
8 changes: 8 additions & 0 deletions examples/prisma/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @pothos-examples/relay

## 2.4.25

### Patch Changes

- Updated dependencies [42bf6190]
- @pothos/core@3.27.0
- @pothos/plugin-prisma@3.41.0

## 2.4.24

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/prisma/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "2.4.24",
"version": "2.4.25",
"name": "@pothos-examples/prisma",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
15 changes: 15 additions & 0 deletions examples/relay-windowed-pagination/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @pothos-examples/prisma-relay

## 2.7.26

### Patch Changes

- Updated dependencies [d60cb49e]
- @pothos/plugin-relay@3.36.0

## 2.7.25

### Patch Changes

- Updated dependencies [42bf6190]
- @pothos/core@3.27.0
- @pothos/plugin-relay@3.35.0

## 2.7.24

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/relay-windowed-pagination/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "2.7.24",
"version": "2.7.26",
"name": "@pothos-examples/relay-windowed-pagination",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
7 changes: 7 additions & 0 deletions examples/simple-classes/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @pothos-examples/simple-classes

## 2.4.20

### Patch Changes

- Updated dependencies [42bf6190]
- @pothos/core@3.27.0

## 2.4.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-classes/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "2.4.19",
"version": "2.4.20",
"name": "@pothos-examples/simple-classes",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
7 changes: 7 additions & 0 deletions examples/simple-interfaces/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @pothos-examples/simple-interfaces

## 2.4.20

### Patch Changes

- Updated dependencies [42bf6190]
- @pothos/core@3.27.0

## 2.4.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-interfaces/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "2.4.19",
"version": "2.4.20",
"name": "@pothos-examples/simple-interfaces",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 3.27.0

### Minor Changes

- 42bf6190: Allow unionType to receive types as a thunk

## 3.26.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pothos/core",
"version": "3.26.0",
"version": "3.27.0",
"description": "Pothos (formerly GiraphQL) is a plugin based schema builder for creating code-first GraphQL schemas in typescript",
"main": "./lib/index.js",
"types": "./dts/index.d.ts",
Expand Down
11 changes: 7 additions & 4 deletions packages/core/src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,22 +423,25 @@ export default class SchemaBuilder<Types extends SchemaTypes> {
ParentShape<Types, Member>
>(name);

options.types.forEach((type) => {
verifyRef(type);
});
if (Array.isArray(options.types)) {
options.types.forEach((type) => {
verifyRef(type);
});
}

const config: PothosUnionTypeConfig = {
kind: 'Union',
graphqlKind: 'Union',
name,
types: (options.types || []) as ObjectParam<SchemaTypes>[],
types: [],
description: options.description,
resolveType: options.resolveType as GraphQLTypeResolver<unknown, object>,
pothosOptions: options as unknown as PothosSchemaTypes.UnionTypeOptions,
extensions: options.extensions,
};

this.configStore.addTypeConfig(config, ref);
this.configStore.addUnionTypes(name, options.types);

return ref;
}
Expand Down
Loading

0 comments on commit 420e975

Please sign in to comment.