@model-ts/graphql 0.0.0-stage → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +1280 -2
- package/dist/.tsbuildinfo +1 -0
- package/dist/Assembly.d.ts +24 -0
- package/dist/Assembly.d.ts.map +1 -0
- package/dist/Assembly.js +236 -0
- package/dist/Assembly.js.map +1 -0
- package/dist/Builder.d.ts +27 -0
- package/dist/Builder.d.ts.map +1 -0
- package/dist/Builder.js +40 -0
- package/dist/Builder.js.map +1 -0
- package/dist/Connections.d.ts +41 -0
- package/dist/Connections.d.ts.map +1 -0
- package/dist/Connections.js +243 -0
- package/dist/Connections.js.map +1 -0
- package/dist/Definitions.d.ts +139 -0
- package/dist/Definitions.d.ts.map +1 -0
- package/dist/Definitions.js +117 -0
- package/dist/Definitions.js.map +1 -0
- package/dist/Errors.d.ts +39 -0
- package/dist/Errors.d.ts.map +1 -0
- package/dist/Errors.js +103 -0
- package/dist/Errors.js.map +1 -0
- package/dist/Execution.d.ts +52 -0
- package/dist/Execution.d.ts.map +1 -0
- package/dist/Execution.js +174 -0
- package/dist/Execution.js.map +1 -0
- package/dist/FieldRuntime.d.ts +5 -0
- package/dist/FieldRuntime.d.ts.map +1 -0
- package/dist/FieldRuntime.js +27 -0
- package/dist/FieldRuntime.js.map +1 -0
- package/dist/FieldTypes.d.ts +232 -0
- package/dist/FieldTypes.d.ts.map +1 -0
- package/dist/FieldTypes.js +6 -0
- package/dist/FieldTypes.js.map +1 -0
- package/dist/Fields.d.ts +8 -0
- package/dist/Fields.d.ts.map +1 -0
- package/dist/Fields.js +72 -0
- package/dist/Fields.js.map +1 -0
- package/dist/Formatting.d.ts +25 -0
- package/dist/Formatting.d.ts.map +1 -0
- package/dist/Formatting.js +29 -0
- package/dist/Formatting.js.map +1 -0
- package/dist/GraphQL.d.ts +10 -0
- package/dist/GraphQL.d.ts.map +1 -0
- package/dist/GraphQL.js +5 -0
- package/dist/GraphQL.js.map +1 -0
- package/dist/InputTypes.d.ts +27 -0
- package/dist/InputTypes.d.ts.map +1 -0
- package/dist/InputTypes.js +203 -0
- package/dist/InputTypes.js.map +1 -0
- package/dist/Registry.d.ts +70 -0
- package/dist/Registry.d.ts.map +1 -0
- package/dist/Registry.js +3 -0
- package/dist/Registry.js.map +1 -0
- package/dist/Resolver.d.ts +30 -0
- package/dist/Resolver.d.ts.map +1 -0
- package/dist/Resolver.js +76 -0
- package/dist/Resolver.js.map +1 -0
- package/dist/Results.d.ts +20 -0
- package/dist/Results.d.ts.map +1 -0
- package/dist/Results.js +79 -0
- package/dist/Results.js.map +1 -0
- package/dist/ScalarBoundary.d.ts +9 -0
- package/dist/ScalarBoundary.d.ts.map +1 -0
- package/dist/ScalarBoundary.js +31 -0
- package/dist/ScalarBoundary.js.map +1 -0
- package/dist/Scalars.d.ts +9 -0
- package/dist/Scalars.d.ts.map +1 -0
- package/dist/Scalars.js +104 -0
- package/dist/Scalars.js.map +1 -0
- package/dist/SchemaTypes.d.ts +55 -0
- package/dist/SchemaTypes.d.ts.map +1 -0
- package/dist/SchemaTypes.js +47 -0
- package/dist/SchemaTypes.js.map +1 -0
- package/dist/Subscription.d.ts +6 -0
- package/dist/Subscription.d.ts.map +1 -0
- package/dist/Subscription.js +60 -0
- package/dist/Subscription.js.map +1 -0
- package/dist/Testing.d.ts +52 -0
- package/dist/Testing.d.ts.map +1 -0
- package/dist/Testing.js +74 -0
- package/dist/Testing.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/SubscriptionRule.d.ts +8 -0
- package/dist/internal/SubscriptionRule.d.ts.map +1 -0
- package/dist/internal/SubscriptionRule.js +73 -0
- package/dist/internal/SubscriptionRule.js.map +1 -0
- package/package.json +55 -4
- package/src/Assembly.ts +352 -0
- package/src/Builder.ts +110 -0
- package/src/Connections.ts +374 -0
- package/src/Definitions.ts +465 -0
- package/src/Errors.ts +188 -0
- package/src/Execution.ts +354 -0
- package/src/FieldRuntime.ts +32 -0
- package/src/FieldTypes.ts +667 -0
- package/src/Fields.ts +117 -0
- package/src/Formatting.ts +54 -0
- package/src/GraphQL.ts +50 -0
- package/src/InputTypes.ts +266 -0
- package/src/Registry.ts +157 -0
- package/src/Resolver.ts +176 -0
- package/src/Results.ts +128 -0
- package/src/ScalarBoundary.ts +30 -0
- package/src/Scalars.ts +143 -0
- package/src/SchemaTypes.ts +90 -0
- package/src/Subscription.ts +93 -0
- package/src/Testing.ts +144 -0
- package/src/index.ts +1 -0
- package/src/internal/SubscriptionRule.ts +90 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @model-ts/graphql
|
|
2
|
+
|
|
3
|
+
## 7.1.0
|
|
4
|
+
|
|
5
|
+
## 7.0.0
|
|
6
|
+
|
|
7
|
+
### Major Changes
|
|
8
|
+
|
|
9
|
+
- dec9d05: Add @model-ts/graphql to the coordinated model-ts 7 release. Build Effect-native GraphQL APIs from registered model and Schema classes, with plain-object field definitions and no server resolver type generation. Field helpers live on the builder next to the definitions (`GraphQL.string()`, `GraphQL.field(...)`, `GraphQL.connection(...)`); `GraphQL.id()` is the ID output field and `GraphQL.id(schema)` a branded ID argument. Preserve typed request context and collect resolver, authorization, subscription, and connection service requirements in the built schema.
|
|
10
|
+
|
|
11
|
+
Support mapped enums, inherited interface fields, tagged and explicitly named unions, nullable and multi-success typed result unions, Schema-decoded inputs with branded IDs and explicit null handling, and custom or adopted scalars. Derive connections over objects, interfaces, and unions; preserve storage pagination defaults and opaque cursors, and resolve total counts only when selected.
|
|
12
|
+
|
|
13
|
+
Execute operations with Effect layers, classify public and internal failures, and report original causes through ErrorReporter. Require graphql-js `^16.11.0`. Test operations and snapshots through @model-ts/graphql/Testing with memory or DynamoDB Local layers, using `Testing.client` to fill a default request context per call and the `graphql` tag to normalize documents with `stripIgnoredCharacters`. Include a user guide covering setup, API concepts, testing, and Promise interoperability.
|
|
14
|
+
|
|
15
|
+
Return JSON-safe formatted query and subscription results from the executor while retaining the direct execution result API. Apply public/internal error policy to custom and adopted scalar callbacks, clone adopted scalars without changing their behavior or metadata, and report unexpected coercion and serialization failures. Preserve original error class instances for registered result fields, and interrupt subscription event work with awaited finalization when consumption is cancelled.
|
|
16
|
+
|
|
17
|
+
Declare executor-owned schema validation so transports can preserve scalar input error policy without validating the same document twice.
|
|
18
|
+
|
|
19
|
+
Validate subscriptions by collecting root response keys through fragments. Accept merged single-root selections, reject multiple keys and root introspection, and reject root `@skip`/`@include` without evaluating variables while preserving nested conditional selections.
|
|
20
|
+
|
|
21
|
+
Define subscription fields with `GraphQL.subscriptionField(name, type, { subscribe, ... })`, where `subscribe` returns an Effect Stream. Reject `subscribe` on object, interface, query, and mutation fields. Remove the unreleased `GraphQL.events` helper. Preserve per-value authorization, decoded arguments, service requirements, error policy, cancellation and finalizers, subscription-root validation, and the `GraphQL.subscribe` execution API.
|
|
22
|
+
|
|
23
|
+
Define roots with `GraphQL.queryField(name, type, config)`, `GraphQL.mutationField(name, type, config)`, and `GraphQL.subscriptionField(name, type, config)`. Accept registered or scalar names and config-less output helpers, including nullable/list combinations and connections. Reuse object field config and resolver shorthand typing, result unions, authorization, pagination options, and service requirements. Require an explicit resolver or subscription config at the root; remove the unreleased root field-map and nested `GraphQL.field(...)` forms. Export one constant per root field through the schema barrel; assembly merges fields by root and rejects duplicate names with the root and field in the diagnostic. Retain request context and schema completeness checking.
|