-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(website): make extensions a top level section
- Loading branch information
1 parent
a3521fb
commit 53abb1c
Showing
29 changed files
with
65 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,40 @@ | ||
import type { Simplify } from 'type-fest' | ||
import { type StringKeyof } from '../../lib/prelude.js' | ||
import type { StringKeyof } from '../../lib/prelude.js' | ||
import type { TSErrorDescriptive } from '../../lib/ts-error.js' | ||
import type { Schema } from '../../types/Schema/__.js' | ||
import type { Select } from '../Select/__.js' | ||
import type { Alias } from './Alias.js' | ||
import type { OutputField } from './OutputField.js' | ||
import type { ScalarsWildcard } from './ScalarsWildcard.js' | ||
|
||
// dprint-ignore | ||
export type Object<$SelectionSet, $Schema extends Schema, $Node extends Schema.OutputObject> = | ||
Select.SelectScalarsWildcard.IsSelectScalarsWildcard<$SelectionSet> extends true | ||
// todo what about when scalars wildcard is combined with other fields like relations? | ||
? ScalarsWildcard<$SelectionSet, $Schema,$Node> | ||
: | ||
Simplify< | ||
& SelectionNonSelectAlias<$SelectionSet, $Schema, $Node> | ||
& Alias<$Schema, $Node, $SelectionSet> | ||
> | ||
? ScalarsWildcard<$SelectionSet, $Schema, $Node> | ||
: Simplify< | ||
& SelectionNonSelectAlias<$SelectionSet, $Schema, $Node> | ||
& Alias<$Schema, $Node, $SelectionSet> | ||
> | ||
|
||
// dprint-ignore | ||
type SelectionNonSelectAlias<$SelectionSet , $Schema extends Schema, $SchemaNode extends Schema.OutputObject> = | ||
{ | ||
[$Key in PickSelectsPositiveIndicatorAndNotSelectAlias<$SelectionSet>]: | ||
$Key extends keyof $SchemaNode['fields'] | ||
? OutputField<$SelectionSet[$Key], $SchemaNode['fields'][$Key], $Schema> | ||
: Errors.UnknownFieldName<$Key, $SchemaNode> | ||
} | ||
type SelectionNonSelectAlias<$SelectionSet, $Schema extends Schema, $Node extends Schema.OutputObject> = { | ||
[$Key in PickSelectsPositiveIndicatorAndNotSelectAlias<$SelectionSet>]: $Key extends keyof $Node['fields'] | ||
? OutputField<$SelectionSet[$Key], $Node['fields'][$Key], $Schema> | ||
: Errors.UnknownFieldName<$Key, $Node> | ||
} | ||
|
||
// dprint-ignore | ||
export namespace Errors { | ||
export type UnknownFieldName<$FieldName extends string, $Object extends Schema.StandardTypes.RootType | Schema.OutputObject> = | ||
TSErrorDescriptive<'Object', `field "${$FieldName}" does not exist on object "${$Object['name']}"`> | ||
export type UnknownFieldName< | ||
$FieldName extends string, | ||
$Object extends Schema.StandardTypes.RootType | Schema.OutputObject, | ||
> = TSErrorDescriptive<'Object', `field "${$FieldName}" does not exist on object "${$Object['name']}"`> | ||
} | ||
|
||
// dprint-ignore | ||
export type PickSelectsPositiveIndicatorAndNotSelectAlias<$SelectionSet> = StringKeyof<{ | ||
[ | ||
$FieldName in keyof $SelectionSet as $SelectionSet[$FieldName] extends Select.Indicator.Negative | ||
? never | ||
: $SelectionSet[$FieldName] extends any[] | ||
? never | ||
: $FieldName | ||
]: 0 | ||
}> | ||
export type PickSelectsPositiveIndicatorAndNotSelectAlias<$SelectionSet> = StringKeyof< | ||
{ | ||
[ | ||
$FieldName in keyof $SelectionSet as $SelectionSet[$FieldName] extends Select.Indicator.Negative ? never | ||
: $SelectionSet[$FieldName] extends any[] ? never | ||
: $FieldName | ||
]: 0 | ||
} | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Extensions | ||
|
||
Welcome to Graffle's collection of extensions. | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!--@include: @../../src/extensions/Introspection/documentation.md--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!--@include: @/../../src/extensions/Opentelemetry/documentation.md--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!--@include: @/../../src/extensions/schemaErrors/documentation.md--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!--@include: @/../../src/extensions/Throws/documentation.md--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<!--@include: @/../../src/extensions/Upload/documentation.md--> | ||
|
||
test |
17 changes: 17 additions & 0 deletions
17
website/content/guides/35_document-builder/10_graphql-feature-mapping.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# GraphQL Feature Mapping | ||
|
||
## Aliases | ||
|
||
## Arguments | ||
|
||
## Custom Scalars | ||
|
||
## Directives | ||
|
||
## Enums | ||
|
||
## Inline Fragments | ||
|
||
### Field Groups | ||
|
||
### Type Conditions |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
website/content/guides/40_graphql-feature-mapping/custom-scalars.md
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
website/content/guides/40_graphql-feature-mapping/directives.md
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
website/content/guides/40_graphql-feature-mapping/interfaces.md
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
website/content/guides/40_graphql-feature-mapping/selection-groups.md
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.