Skip to content

Commit

Permalink
Allow overwriting built-in types
Browse files Browse the repository at this point in the history
  • Loading branch information
mishushakov committed Feb 25, 2024
1 parent ca1b8bd commit 9de43dd
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 96 deletions.
56 changes: 28 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "git",
"url": "https://github.com/stepci/garph"
},
"version": "0.6.6",
"version": "0.6.7",
"license": "MIT",
"main": "dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ export class GarphSchema {

registerType(type: AnyType) {
const name = type.typeDef.name
if (this.types.has(name)) throw new Error(`Type with name "${name}" already exists`)
if (!['Node', 'PageInfo'].includes(name) && this.types.has(name)) throw new Error(`Type with name "${name}" already exists`)
this.types.set(name, type)
}

Expand Down
42 changes: 21 additions & 21 deletions www/api/classes/GarphSchema.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#### Defined in

[index.ts:625](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L625)
[index.ts:625](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L625)

## Properties

Expand All @@ -27,7 +27,7 @@

#### Defined in

[index.ts:601](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L601)
[index.ts:601](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L601)

___

Expand All @@ -46,7 +46,7 @@ ___

#### Defined in

[index.ts:612](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L612)
[index.ts:612](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L612)

___

Expand All @@ -56,7 +56,7 @@ ___

#### Defined in

[index.ts:605](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L605)
[index.ts:605](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L605)

___

Expand All @@ -66,7 +66,7 @@ ___

#### Defined in

[index.ts:599](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L599)
[index.ts:599](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L599)

## Methods

Expand All @@ -80,7 +80,7 @@ ___

#### Defined in

[index.ts:710](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L710)
[index.ts:710](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L710)

___

Expand Down Expand Up @@ -108,7 +108,7 @@ ___

#### Defined in

[index.ts:641](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L641)
[index.ts:641](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L641)

___

Expand Down Expand Up @@ -136,7 +136,7 @@ ___

#### Defined in

[index.ts:651](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L651)
[index.ts:651](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L651)

___

Expand Down Expand Up @@ -164,7 +164,7 @@ ___

#### Defined in

[index.ts:670](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L670)
[index.ts:670](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L670)

___

Expand All @@ -178,7 +178,7 @@ ___

#### Defined in

[index.ts:706](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L706)
[index.ts:706](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L706)

___

Expand All @@ -192,7 +192,7 @@ ___

#### Defined in

[index.ts:698](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L698)
[index.ts:698](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L698)

___

Expand Down Expand Up @@ -220,7 +220,7 @@ ___

#### Defined in

[index.ts:664](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L664)
[index.ts:664](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L664)

___

Expand All @@ -234,7 +234,7 @@ ___

#### Defined in

[index.ts:702](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L702)
[index.ts:702](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L702)

___

Expand Down Expand Up @@ -262,7 +262,7 @@ ___

#### Defined in

[index.ts:688](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L688)
[index.ts:688](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L688)

___

Expand Down Expand Up @@ -290,7 +290,7 @@ ___

#### Defined in

[index.ts:635](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L635)
[index.ts:635](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L635)

___

Expand All @@ -316,7 +316,7 @@ ___

#### Defined in

[index.ts:716](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L716)
[index.ts:716](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L716)

___

Expand All @@ -336,7 +336,7 @@ ___

#### Defined in

[index.ts:619](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L619)
[index.ts:619](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L619)

___

Expand Down Expand Up @@ -364,7 +364,7 @@ ___

#### Defined in

[index.ts:682](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L682)
[index.ts:682](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L682)

___

Expand All @@ -378,7 +378,7 @@ ___

#### Defined in

[index.ts:694](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L694)
[index.ts:694](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L694)

___

Expand Down Expand Up @@ -406,7 +406,7 @@ ___

#### Defined in

[index.ts:629](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L629)
[index.ts:629](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L629)

___

Expand Down Expand Up @@ -434,4 +434,4 @@ ___

#### Defined in

[index.ts:676](https://github.com/stepci/garph/blob/11bfe12/src/index.ts#L676)
[index.ts:676](https://github.com/stepci/garph/blob/ca1b8bd/src/index.ts#L676)
Loading

0 comments on commit 9de43dd

Please sign in to comment.