@effect-gql/federation 0.1.0 → 1.0.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/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/scalars.ts","../src/entities.ts","../src/types.ts","../src/federated-builder.ts","../src/directives.ts","../src/pipe-api.ts"],"names":["field","entity","Effect","GraphQLObjectType","key"],"mappings":";;;;;AAKA,SAAS,oBAAoB,GAAA,EAAyB;AACpD,EAAA,QAAQ,IAAI,IAAA;AAAM,IAChB,KAAK,IAAA,CAAK,MAAA;AAAA,IACV,KAAK,IAAA,CAAK,OAAA;AACR,MAAA,OAAO,GAAA,CAAI,KAAA;AAAA,IACb,KAAK,IAAA,CAAK,GAAA;AACR,MAAA,OAAO,QAAA,CAAS,GAAA,CAAI,KAAA,EAAO,EAAE,CAAA;AAAA,IAC/B,KAAK,IAAA,CAAK,KAAA;AACR,MAAA,OAAO,UAAA,CAAW,IAAI,KAAK,CAAA;AAAA,IAC7B,KAAK,IAAA,CAAK,IAAA;AACR,MAAA,OAAO,IAAA;AAAA,IACT,KAAK,IAAA,CAAK,IAAA;AACR,MAAA,OAAO,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,mBAAmB,CAAA;AAAA,IAC3C,KAAK,KAAK,MAAA,EAAQ;AAChB,MAAA,MAAM,MAA+B,EAAC;AACtC,MAAA,KAAA,MAAWA,MAAAA,IAAS,IAAI,MAAA,EAAQ;AAC9B,QAAA,GAAA,CAAIA,OAAM,IAAA,CAAK,KAAK,CAAA,GAAI,mBAAA,CAAoBA,OAAM,KAAK,CAAA;AAAA,MACzD;AACA,MAAA,OAAO,GAAA;AAAA,IACT;AAAA,IACA;AACE,MAAA,OAAO,MAAA;AAAA;AAEb;AAMO,IAAM,SAAA,GAAY,IAAI,iBAAA,CAAkB;AAAA,EAC7C,IAAA,EAAM,MAAA;AAAA,EACN,WAAA,EACE,qFAAA;AAAA,EACF,SAAA,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,CAAC,EAAE,IAAA,EAAM,YAAY,CAAA;AAAA,EACjC,OAAA,EAAS,CAAC,MAAA,KAAgBF,MAAAA,CAAO,QAAQ,MAAM;AACjD,CAAA;AAKO,IAAM,aAAA,GAAgB,CAAwB,MAAA,MAU/C;AAAA,EACJ,MAAM,MAAA,CAAO,IAAA;AAAA,EACb,aAAa,MAAA,CAAO,WAAA;AAAA,EACpB,UAAA,EAAY,CAAC,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,EAAE,MAAA,EAAQ,MAAA,CAAO,MAAA,EAAO,EAAG,CAAA;AAAA,EAClE,SAAS,MAAA,CAAO;AAClB,CAAA;AAKO,IAAM,aAAA,GAAgB,CAAwB,MAAA,MAU/C;AAAA,EACJ,MAAM,MAAA,CAAO,IAAA;AAAA,EACb,aAAa,MAAA,CAAO,WAAA;AAAA,EACpB,UAAA,EAAY,CAAC,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,EAAE,MAAA,EAAQ,MAAA,CAAO,MAAA,EAAO,EAAG,CAAA;AAAA,EAClE,SAAS,MAAA,CAAO;AAClB,CAAA;AAKO,IAAM,aAAA,GAAgB,CAAwB,MAAA,MAW/C;AAAA,EACJ,MAAM,MAAA,CAAO,IAAA;AAAA,EACb,aAAa,MAAA,CAAO,WAAA;AAAA,EACpB,UAAA,EAAY;AAAA,IACV;AAAA,MACE,IAAA,EAAM,UAAA;AAAA,MACN,IAAA,EAAM;AAAA,QACJ,MAAM,MAAA,CAAO,IAAA;AAAA,QACb,GAAI,OAAO,KAAA,KAAU,MAAA,GAAY,EAAE,KAAA,EAAO,MAAA,CAAO,KAAA,EAAM,GAAI;AAAC;AAC9D;AACF,GACF;AAAA,EACA,SAAS,MAAA,CAAO;AAClB,CAAA","file":"index.js","sourcesContent":["import { GraphQLScalarType, Kind, type ValueNode } from \"@effect-gql/core\"\n\n/**\n * Parse a literal value from the AST to a JavaScript value\n */\nfunction parseLiteralToValue(ast: ValueNode): unknown {\n switch (ast.kind) {\n case Kind.STRING:\n case Kind.BOOLEAN:\n return ast.value\n case Kind.INT:\n return parseInt(ast.value, 10)\n case Kind.FLOAT:\n return parseFloat(ast.value)\n case Kind.NULL:\n return null\n case Kind.LIST:\n return ast.values.map(parseLiteralToValue)\n case Kind.OBJECT: {\n const obj: Record<string, unknown> = {}\n for (const field of ast.fields) {\n obj[field.name.value] = parseLiteralToValue(field.value)\n }\n return obj\n }\n default:\n return undefined\n }\n}\n\n/**\n * The _Any scalar is used for entity representations in the _entities query.\n * It accepts any JSON value representing an entity with __typename and key fields.\n */\nexport const AnyScalar = new GraphQLScalarType({\n name: \"_Any\",\n description:\n \"The _Any scalar is used to pass representations of entities from external services.\",\n serialize: (value) => value,\n parseValue: (value) => value,\n parseLiteral: parseLiteralToValue,\n})\n\n/**\n * The _FieldSet scalar represents a selection of fields.\n * It's used in directive arguments like @key(fields: \"id\") and @requires(fields: \"weight\").\n */\nexport const FieldSetScalar = new GraphQLScalarType({\n name: \"_FieldSet\",\n description: \"A string representing a selection of fields.\",\n serialize: (value) => value,\n parseValue: (value) => value,\n parseLiteral: (ast) => {\n if (ast.kind === Kind.STRING) {\n return ast.value\n }\n return undefined\n },\n})\n","import { Effect, Runtime } from \"effect\"\nimport { GraphQLObjectType, GraphQLUnionType, GraphQLString } from \"@effect-gql/core\"\nimport type { EntityRegistration, EntityRepresentation } from \"./types\"\n\n/**\n * Create the _Entity union type from registered entities\n */\nexport function createEntityUnion(\n entities: Map<string, EntityRegistration<any, any>>,\n typeRegistry: Map<string, GraphQLObjectType>\n): GraphQLUnionType {\n const types = Array.from(entities.keys())\n .map((name) => typeRegistry.get(name)!)\n .filter(Boolean)\n\n if (types.length === 0) {\n throw new Error(\"At least one entity must be registered to create _Entity union\")\n }\n\n return new GraphQLUnionType({\n name: \"_Entity\",\n description: \"Union of all types that have @key directives\",\n types: () => types,\n resolveType: (value: any) => value.__typename,\n })\n}\n\n/**\n * Create the _entities resolver\n *\n * This resolver receives an array of representations (objects with __typename and key fields)\n * and returns the corresponding entities by calling each entity's resolveReference function.\n *\n * Uses Effect.all with unbounded concurrency to resolve all entities in parallel.\n */\nexport function createEntitiesResolver<R>(entities: Map<string, EntityRegistration<any, R>>) {\n return async (\n _parent: any,\n args: { representations: readonly EntityRepresentation[] },\n context: { runtime: Runtime.Runtime<R> }\n ): Promise<(any | null)[]> => {\n const effects = args.representations.map((representation) => {\n const entityName = representation.__typename\n const entity = entities.get(entityName)\n\n if (!entity) {\n return Effect.fail(new Error(`Unknown entity type: ${entityName}`))\n }\n\n return entity.resolveReference(representation as any).pipe(\n Effect.map((result) => {\n // Add __typename to the result for union type resolution\n if (result !== null && typeof result === \"object\") {\n return { ...result, __typename: entityName }\n }\n return result\n }),\n // Catch individual entity resolution errors and return null\n Effect.catchAll((error) =>\n Effect.logError(`Failed to resolve entity ${entityName}`, error).pipe(Effect.as(null))\n )\n )\n })\n\n return Runtime.runPromise(context.runtime)(Effect.all(effects, { concurrency: \"unbounded\" }))\n }\n}\n\n/**\n * Create the _Service type for SDL introspection\n */\nexport function createServiceType(): GraphQLObjectType {\n return new GraphQLObjectType({\n name: \"_Service\",\n description: \"Provides SDL for the subgraph schema\",\n fields: {\n sdl: {\n type: GraphQLString,\n description: \"The SDL representing the subgraph schema\",\n },\n },\n })\n}\n\n/**\n * Create the _service resolver\n */\nexport function createServiceResolver(sdl: string) {\n return () => ({ sdl })\n}\n","import { Effect } from \"effect\"\nimport * as S from \"effect/Schema\"\n\n/**\n * Configuration for a @key directive\n */\nexport interface KeyDirective {\n /** FieldSet selection string (e.g., \"id\" or \"sku package\") */\n readonly fields: string\n /** Whether this key can be used to resolve the entity. Default: true */\n readonly resolvable?: boolean\n}\n\n/**\n * All Federation 2.x directive types\n */\nexport type FederationDirective =\n | { readonly _tag: \"key\"; readonly fields: string; readonly resolvable?: boolean }\n | { readonly _tag: \"external\" }\n | { readonly _tag: \"requires\"; readonly fields: string }\n | { readonly _tag: \"provides\"; readonly fields: string }\n | { readonly _tag: \"shareable\" }\n | { readonly _tag: \"inaccessible\" }\n | { readonly _tag: \"override\"; readonly from: string; readonly label?: string }\n | { readonly _tag: \"interfaceObject\" }\n | { readonly _tag: \"tag\"; readonly name: string }\n\n/**\n * Entity representation sent to _entities query\n * Contains __typename plus the key fields\n */\nexport interface EntityRepresentation {\n readonly __typename: string\n readonly [key: string]: unknown\n}\n\n/**\n * Configuration for registering an entity type\n */\nexport interface EntityRegistration<A, R = never> {\n /** Type name */\n readonly name: string\n /** Effect Schema for the entity type */\n readonly schema: S.Schema<A, any, any>\n /** Key directive configurations (at least one required) */\n readonly keys: readonly KeyDirective[]\n /** Additional directives to apply to the type */\n readonly directives?: readonly FederationDirective[]\n /**\n * Reference resolver - given key fields, return the full entity.\n * The representation contains __typename plus all fields from any matching @key.\n */\n readonly resolveReference: (\n representation: Partial<A> & { __typename: string }\n ) => Effect.Effect<A | null, any, R>\n}\n\n/**\n * Configuration for the FederatedSchemaBuilder\n */\nexport interface FederatedSchemaConfig {\n /** Federation specification version (default: \"2.3\") */\n readonly version?: string\n}\n\n/**\n * Result of building a federated schema\n */\nexport interface FederatedSchemaResult {\n /** The GraphQL schema with Federation queries */\n readonly schema: import(\"graphql\").GraphQLSchema\n /** The Federation-compliant SDL with directive annotations */\n readonly sdl: string\n}\n\n/**\n * Convert a FederationDirective to a DirectiveApplication\n */\nexport function toDirectiveApplication(\n directive: FederationDirective\n): import(\"@effect-gql/core\").DirectiveApplication {\n switch (directive._tag) {\n case \"key\":\n return {\n name: \"key\",\n args: {\n fields: directive.fields,\n ...(directive.resolvable !== undefined ? { resolvable: directive.resolvable } : {}),\n },\n }\n case \"external\":\n return { name: \"external\" }\n case \"requires\":\n return { name: \"requires\", args: { fields: directive.fields } }\n case \"provides\":\n return { name: \"provides\", args: { fields: directive.fields } }\n case \"shareable\":\n return { name: \"shareable\" }\n case \"inaccessible\":\n return { name: \"inaccessible\" }\n case \"override\":\n return {\n name: \"override\",\n args: {\n from: directive.from,\n ...(directive.label !== undefined ? { label: directive.label } : {}),\n },\n }\n case \"interfaceObject\":\n return { name: \"interfaceObject\" }\n case \"tag\":\n return { name: \"tag\", args: { name: directive.name } }\n }\n}\n","import { Effect, Pipeable } from \"effect\"\nimport * as S from \"effect/Schema\"\nimport {\n GraphQLSchemaBuilder,\n GraphQLSchema,\n GraphQLObjectType,\n GraphQLList,\n GraphQLNonNull,\n printSchema,\n type DirectiveApplication,\n} from \"@effect-gql/core\"\nimport { AnyScalar, FieldSetScalar } from \"./scalars\"\nimport {\n createEntityUnion,\n createEntitiesResolver,\n createServiceType,\n createServiceResolver,\n} from \"./entities\"\nimport type { EntityRegistration, FederatedSchemaConfig, FederatedSchemaResult } from \"./types\"\nimport { toDirectiveApplication } from \"./types\"\n\n/**\n * Internal state for the federated builder\n */\ninterface FederatedBuilderState<R> {\n /** Underlying core builder */\n coreBuilder: GraphQLSchemaBuilder<R>\n /** Registered entities */\n entities: Map<string, EntityRegistration<any, any>>\n /** Federation version */\n version: string\n}\n\n/**\n * Federation-aware schema builder that extends the core GraphQLSchemaBuilder\n * with Apollo Federation 2.x support.\n *\n * @example\n * ```typescript\n * const schema = FederatedSchemaBuilder.empty\n * .pipe(\n * entity({\n * name: \"User\",\n * schema: UserSchema,\n * keys: [key({ fields: \"id\" })],\n * resolveReference: (ref) => UserService.findById(ref.id),\n * }),\n * query(\"me\", {\n * type: UserSchema,\n * resolve: () => UserService.getCurrentUser(),\n * }),\n * )\n * .buildFederatedSchema()\n * ```\n */\nexport class FederatedSchemaBuilder<R = never> implements Pipeable.Pipeable {\n private constructor(private readonly state: FederatedBuilderState<R>) {}\n\n /**\n * Pipeable interface implementation\n */\n pipe<A>(this: A): A\n pipe<A, B>(this: A, ab: (a: A) => B): B\n pipe<A, B, C>(this: A, ab: (a: A) => B, bc: (b: B) => C): C\n pipe<A, B, C, D>(this: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D): D\n pipe<A, B, C, D, E>(\n this: A,\n ab: (a: A) => B,\n bc: (b: B) => C,\n cd: (c: C) => D,\n de: (d: D) => E\n ): E\n pipe<A, B, C, D, E, F>(\n this: A,\n ab: (a: A) => B,\n bc: (b: B) => C,\n cd: (c: C) => D,\n de: (d: D) => E,\n ef: (e: E) => F\n ): F\n pipe() {\n return Pipeable.pipeArguments(this, arguments)\n }\n\n /**\n * Create an empty federated schema builder\n */\n static empty = new FederatedSchemaBuilder<never>({\n coreBuilder: GraphQLSchemaBuilder.empty,\n entities: new Map(),\n version: \"2.3\",\n })\n\n /**\n * Create a builder with custom configuration\n */\n static create(config: FederatedSchemaConfig = {}) {\n return new FederatedSchemaBuilder<never>({\n coreBuilder: GraphQLSchemaBuilder.empty,\n entities: new Map(),\n version: config.version ?? \"2.3\",\n })\n }\n\n /**\n * Create a new builder with updated state\n */\n private with<R2>(updates: Partial<FederatedBuilderState<R2>>): FederatedSchemaBuilder<R | R2> {\n return new FederatedSchemaBuilder({\n ...this.state,\n ...updates,\n } as FederatedBuilderState<R | R2>)\n }\n\n /**\n * Get the underlying core builder for advanced usage\n */\n get coreBuilder(): GraphQLSchemaBuilder<R> {\n return this.state.coreBuilder\n }\n\n // ============================================================================\n // Entity Registration\n // ============================================================================\n\n /**\n * Register an entity type with @key directive(s) and reference resolver.\n *\n * Entities are the core building block of Apollo Federation. They represent\n * types that can be resolved across subgraph boundaries using their key fields.\n *\n * @example\n * ```typescript\n * builder.entity({\n * name: \"User\",\n * schema: UserSchema,\n * keys: [key({ fields: \"id\" })],\n * resolveReference: (ref) => UserService.findById(ref.id),\n * })\n * ```\n */\n entity<A, R2>(config: EntityRegistration<A, R2>): FederatedSchemaBuilder<R | R2> {\n const { name, schema, keys, directives } = config\n\n // Build directive applications for the object type\n const typeDirectives: DirectiveApplication[] = [\n // Add @key directives\n ...keys.map(\n (k): DirectiveApplication => ({\n name: \"key\",\n args: {\n fields: k.fields,\n ...(k.resolvable !== undefined ? { resolvable: k.resolvable } : {}),\n },\n })\n ),\n // Add additional directives\n ...(directives?.map(toDirectiveApplication) ?? []),\n ]\n\n // Register the entity as an object type with directives\n const newCoreBuilder = this.state.coreBuilder.objectType({\n name,\n schema,\n directives: typeDirectives,\n })\n\n // Add to entities map\n const newEntities = new Map(this.state.entities)\n newEntities.set(name, config)\n\n return this.with({\n coreBuilder: newCoreBuilder as GraphQLSchemaBuilder<any>,\n entities: newEntities,\n })\n }\n\n // ============================================================================\n // Delegate to Core Builder\n // ============================================================================\n\n /**\n * Add a query field\n */\n query<A, E, R2, Args = void>(\n name: string,\n config: {\n type: S.Schema<A, any, any>\n args?: S.Schema<Args, any, any>\n description?: string\n directives?: readonly DirectiveApplication[]\n resolve: (args: Args) => Effect.Effect<A, E, R2>\n }\n ): FederatedSchemaBuilder<R | R2> {\n return this.with({\n coreBuilder: this.state.coreBuilder.query(name, config) as GraphQLSchemaBuilder<any>,\n })\n }\n\n /**\n * Add a mutation field\n */\n mutation<A, E, R2, Args = void>(\n name: string,\n config: {\n type: S.Schema<A, any, any>\n args?: S.Schema<Args, any, any>\n description?: string\n directives?: readonly DirectiveApplication[]\n resolve: (args: Args) => Effect.Effect<A, E, R2>\n }\n ): FederatedSchemaBuilder<R | R2> {\n return this.with({\n coreBuilder: this.state.coreBuilder.mutation(name, config) as GraphQLSchemaBuilder<any>,\n })\n }\n\n /**\n * Add a subscription field\n */\n subscription<A, E, R2, Args = void>(\n name: string,\n config: {\n type: S.Schema<A, any, any>\n args?: S.Schema<Args, any, any>\n description?: string\n directives?: readonly DirectiveApplication[]\n subscribe: (args: Args) => Effect.Effect<import(\"effect\").Stream.Stream<A, E, R2>, E, R2>\n resolve?: (value: A, args: Args) => Effect.Effect<A, E, R2>\n }\n ): FederatedSchemaBuilder<R | R2> {\n return this.with({\n coreBuilder: this.state.coreBuilder.subscription(name, config) as GraphQLSchemaBuilder<any>,\n })\n }\n\n /**\n * Register an object type (non-entity)\n */\n objectType<A, R2 = never>(config: {\n name?: string\n schema: S.Schema<A, any, any>\n implements?: readonly string[]\n directives?: readonly DirectiveApplication[]\n }): FederatedSchemaBuilder<R | R2> {\n return this.with({\n coreBuilder: this.state.coreBuilder.objectType(config) as GraphQLSchemaBuilder<any>,\n })\n }\n\n /**\n * Register an interface type\n */\n interfaceType(config: {\n name?: string\n schema: S.Schema<any, any, any>\n resolveType?: (value: any) => string\n directives?: readonly DirectiveApplication[]\n }): FederatedSchemaBuilder<R> {\n return this.with({\n coreBuilder: this.state.coreBuilder.interfaceType(config),\n })\n }\n\n /**\n * Register an enum type\n */\n enumType(config: {\n name: string\n values: readonly string[]\n description?: string\n directives?: readonly DirectiveApplication[]\n }): FederatedSchemaBuilder<R> {\n return this.with({\n coreBuilder: this.state.coreBuilder.enumType(config),\n })\n }\n\n /**\n * Register a union type\n */\n unionType(config: {\n name: string\n types: readonly string[]\n resolveType?: (value: any) => string\n directives?: readonly DirectiveApplication[]\n }): FederatedSchemaBuilder<R> {\n return this.with({\n coreBuilder: this.state.coreBuilder.unionType(config),\n })\n }\n\n /**\n * Register an input type\n */\n inputType(config: {\n name?: string\n schema: S.Schema<any, any, any>\n description?: string\n directives?: readonly DirectiveApplication[]\n }): FederatedSchemaBuilder<R> {\n return this.with({\n coreBuilder: this.state.coreBuilder.inputType(config),\n })\n }\n\n /**\n * Add a computed/relational field to an object type\n */\n field<Parent, A, E, R2, Args = void>(\n typeName: string,\n fieldName: string,\n config: {\n type: S.Schema<A, any, any>\n args?: S.Schema<Args, any, any>\n description?: string\n directives?: readonly DirectiveApplication[]\n resolve: (parent: Parent, args: Args) => Effect.Effect<A, E, R2>\n }\n ): FederatedSchemaBuilder<R | R2> {\n return this.with({\n coreBuilder: this.state.coreBuilder.field(\n typeName,\n fieldName,\n config\n ) as GraphQLSchemaBuilder<any>,\n })\n }\n\n // ============================================================================\n // Schema Building\n // ============================================================================\n\n /**\n * Build the federated GraphQL schema with _entities and _service queries.\n *\n * Returns both the executable schema and the Federation-compliant SDL.\n */\n buildFederatedSchema(): FederatedSchemaResult {\n // Add a dummy query if no queries exist to ensure schema builds properly\n // This ensures all registered types are included in the schema\n let builderForSchema = this.state.coreBuilder\n\n // Check if we need a placeholder query by attempting to build\n // We need at least one query for GraphQL schema to be valid\n const needsPlaceholder = !this.hasQueryFields()\n\n if (needsPlaceholder) {\n builderForSchema = builderForSchema.query(\"_placeholder\", {\n type: S.String,\n resolve: () => Effect.succeed(\"placeholder\"),\n }) as GraphQLSchemaBuilder<any>\n }\n\n // Build the base schema with all types included\n const baseSchema = builderForSchema.buildSchema()\n\n // Get the type registry from the base schema\n const typeRegistry = new Map<string, GraphQLObjectType>()\n const typeMap = baseSchema.getTypeMap()\n\n for (const [name, type] of Object.entries(typeMap)) {\n // Use constructor name check instead of instanceof to handle multiple graphql instances\n const isObjectType = type.constructor.name === \"GraphQLObjectType\"\n if (isObjectType && !name.startsWith(\"__\")) {\n typeRegistry.set(name, type as GraphQLObjectType)\n }\n }\n\n // Create federation types\n const entityUnion =\n this.state.entities.size > 0 ? createEntityUnion(this.state.entities, typeRegistry) : null\n const serviceType = createServiceType()\n\n // Build federation query fields\n const federationQueryFields: Record<string, any> = {}\n\n if (entityUnion) {\n federationQueryFields._entities = {\n type: new GraphQLNonNull(new GraphQLList(entityUnion)),\n args: {\n representations: {\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(AnyScalar))),\n },\n },\n resolve: createEntitiesResolver(this.state.entities),\n }\n }\n\n // Generate SDL before adding _service (to avoid circular reference)\n const sdl = this.generateFederatedSDL(baseSchema, needsPlaceholder)\n\n federationQueryFields._service = {\n type: new GraphQLNonNull(serviceType),\n resolve: createServiceResolver(sdl),\n }\n\n // Build the final schema by extending the base Query type\n const baseQueryType = baseSchema.getQueryType()\n const baseQueryFields = baseQueryType?.getFields() ?? {}\n\n const queryType = new GraphQLObjectType({\n name: \"Query\",\n fields: () => {\n const fields: Record<string, any> = {}\n\n // Copy base query fields (excluding placeholder)\n for (const [name, field] of Object.entries(baseQueryFields)) {\n if (name === \"_placeholder\") continue\n fields[name] = {\n type: field.type,\n args: field.args.reduce(\n (acc, arg) => {\n acc[arg.name] = {\n type: arg.type,\n description: arg.description,\n defaultValue: arg.defaultValue,\n }\n return acc\n },\n {} as Record<string, any>\n ),\n description: field.description,\n resolve: field.resolve,\n extensions: field.extensions,\n }\n }\n\n // Add federation fields\n Object.assign(fields, federationQueryFields)\n\n return fields\n },\n })\n\n // Collect all types for the schema\n const types: any[] = [AnyScalar, FieldSetScalar, serviceType]\n\n if (entityUnion) {\n types.push(entityUnion)\n }\n\n // Add all types from base schema except Query\n for (const [name, type] of Object.entries(typeMap)) {\n if (!name.startsWith(\"__\") && name !== \"Query\") {\n types.push(type)\n }\n }\n\n const schema = new GraphQLSchema({\n query: queryType,\n mutation: baseSchema.getMutationType() ?? undefined,\n subscription: baseSchema.getSubscriptionType() ?? undefined,\n types,\n })\n\n return { schema, sdl }\n }\n\n /**\n * Check if the core builder has any query fields registered\n */\n private hasQueryFields(): boolean {\n // We need to check if there are any queries registered\n // Since we can't access private state, we try building and check\n try {\n const schema = this.state.coreBuilder.buildSchema()\n const queryType = schema.getQueryType()\n return queryType !== null && queryType !== undefined\n } catch {\n return false\n }\n }\n\n /**\n * Build a standard (non-federated) schema.\n * Useful for testing or running without a gateway.\n */\n buildSchema(): GraphQLSchema {\n return this.state.coreBuilder.buildSchema()\n }\n\n // ============================================================================\n // SDL Generation\n // ============================================================================\n\n /**\n * Generate Federation-compliant SDL with directive annotations.\n */\n private generateFederatedSDL(schema: GraphQLSchema, excludePlaceholder: boolean = false): string {\n // Start with federation schema extension\n const lines: string[] = [\n `extend schema @link(url: \"https://specs.apollo.dev/federation/v${this.state.version}\", import: [\"@key\", \"@shareable\", \"@external\", \"@requires\", \"@provides\", \"@override\", \"@inaccessible\", \"@interfaceObject\", \"@tag\"])`,\n \"\",\n ]\n\n // Print the base schema SDL\n let baseSDL = printSchema(schema)\n\n // Remove placeholder query if it was added\n if (excludePlaceholder) {\n baseSDL = baseSDL.replace(/\\s*_placeholder:\\s*String\\n?/g, \"\")\n }\n\n // Process the SDL to add directive annotations\n const annotatedSDL = this.annotateSDLWithDirectives(baseSDL, schema)\n\n lines.push(annotatedSDL)\n\n return lines.join(\"\\n\")\n }\n\n /**\n * Annotate SDL types with their federation directives from extensions.\n */\n private annotateSDLWithDirectives(sdl: string, schema: GraphQLSchema): string {\n const typeMap = schema.getTypeMap()\n let result = sdl\n\n for (const [typeName, type] of Object.entries(typeMap)) {\n if (typeName.startsWith(\"__\")) continue\n\n const directives = (type.extensions as any)?.directives as DirectiveApplication[] | undefined\n if (!directives || directives.length === 0) continue\n\n const directiveStr = directives.map(formatDirective).join(\" \")\n\n // Match type definition and add directives\n const typePattern = new RegExp(\n `(type\\\\s+${typeName}(?:\\\\s+implements\\\\s+[^{]+)?)(\\\\s*\\\\{)`,\n \"g\"\n )\n result = result.replace(typePattern, `$1 ${directiveStr}$2`)\n\n const interfacePattern = new RegExp(`(interface\\\\s+${typeName})(\\\\s*\\\\{)`, \"g\")\n result = result.replace(interfacePattern, `$1 ${directiveStr}$2`)\n\n const enumPattern = new RegExp(`(enum\\\\s+${typeName})(\\\\s*\\\\{)`, \"g\")\n result = result.replace(enumPattern, `$1 ${directiveStr}$2`)\n\n const unionPattern = new RegExp(`(union\\\\s+${typeName})(\\\\s*=)`, \"g\")\n result = result.replace(unionPattern, `$1 ${directiveStr}$2`)\n\n const inputPattern = new RegExp(`(input\\\\s+${typeName})(\\\\s*\\\\{)`, \"g\")\n result = result.replace(inputPattern, `$1 ${directiveStr}$2`)\n }\n\n // Also annotate fields with directives\n for (const [typeName, type] of Object.entries(typeMap)) {\n if (typeName.startsWith(\"__\")) continue\n if (!(type instanceof GraphQLObjectType)) continue\n\n const fields = type.getFields()\n for (const [fieldName, field] of Object.entries(fields)) {\n const fieldDirectives = (field.extensions as any)?.directives as\n | DirectiveApplication[]\n | undefined\n if (!fieldDirectives || fieldDirectives.length === 0) continue\n\n const directiveStr = fieldDirectives.map(formatDirective).join(\" \")\n\n // Only replace within the context of this type\n const typeBlockPattern = new RegExp(\n `(type\\\\s+${typeName}[^{]*\\\\{[\\\\s\\\\S]*?)(${fieldName}(?:\\\\([^)]*\\\\))?:\\\\s*[^\\\\n]+?)([\\\\n}])`,\n \"g\"\n )\n result = result.replace(typeBlockPattern, `$1$2 ${directiveStr}$3`)\n }\n }\n\n return result\n }\n}\n\n/**\n * Format a DirectiveApplication as SDL string\n */\nfunction formatDirective(directive: DirectiveApplication): string {\n if (!directive.args || Object.keys(directive.args).length === 0) {\n return `@${directive.name}`\n }\n\n const args = Object.entries(directive.args)\n .map(([key, value]) => {\n if (typeof value === \"string\") {\n return `${key}: \"${value}\"`\n }\n return `${key}: ${JSON.stringify(value)}`\n })\n .join(\", \")\n\n return `@${directive.name}(${args})`\n}\n","import type { FederationDirective, KeyDirective } from \"./types\"\n\n// ============================================================================\n// Type-Level Directive Factories\n// ============================================================================\n\n/**\n * Create a @key directive for entity identification\n *\n * @example\n * ```typescript\n * entity({\n * name: \"User\",\n * schema: UserSchema,\n * keys: [key({ fields: \"id\" })],\n * resolveReference: (ref) => UserService.findById(ref.id),\n * })\n * ```\n */\nexport const key = (config: KeyDirective): FederationDirective => ({\n _tag: \"key\",\n fields: config.fields,\n resolvable: config.resolvable,\n})\n\n/**\n * Create a @shareable directive\n * Marks a type or field as resolvable by multiple subgraphs\n *\n * @example\n * ```typescript\n * entity({\n * name: \"Product\",\n * schema: ProductSchema,\n * keys: [key({ fields: \"id\" })],\n * directives: [shareable()],\n * })\n * ```\n */\nexport const shareable = (): FederationDirective => ({\n _tag: \"shareable\",\n})\n\n/**\n * Create an @inaccessible directive\n * Omits the type/field from the public API while keeping it available for federation\n *\n * @example\n * ```typescript\n * objectType({\n * name: \"InternalMetadata\",\n * schema: MetadataSchema,\n * directives: [inaccessible()],\n * })\n * ```\n */\nexport const inaccessible = (): FederationDirective => ({\n _tag: \"inaccessible\",\n})\n\n/**\n * Create an @interfaceObject directive\n * Indicates this object represents an interface from another subgraph\n *\n * @example\n * ```typescript\n * objectType({\n * name: \"Media\",\n * schema: MediaSchema,\n * directives: [interfaceObject()],\n * })\n * ```\n */\nexport const interfaceObject = (): FederationDirective => ({\n _tag: \"interfaceObject\",\n})\n\n/**\n * Create a @tag directive for metadata annotation\n *\n * @example\n * ```typescript\n * entity({\n * name: \"Product\",\n * schema: ProductSchema,\n * keys: [key({ fields: \"id\" })],\n * directives: [tag(\"public\"), tag(\"catalog\")],\n * })\n * ```\n */\nexport const tag = (name: string): FederationDirective => ({\n _tag: \"tag\",\n name,\n})\n\n// ============================================================================\n// Field-Level Directive Factories\n// ============================================================================\n\n/**\n * Create an @external directive\n * Marks a field as defined in another subgraph\n *\n * @example\n * ```typescript\n * field(\"User\", \"externalId\", {\n * type: S.String,\n * directives: [external()],\n * resolve: (parent) => parent.externalId,\n * })\n * ```\n */\nexport const external = (): FederationDirective => ({\n _tag: \"external\",\n})\n\n/**\n * Create a @requires directive\n * Specifies fields that must be fetched from other subgraphs before this field can be resolved\n *\n * @example\n * ```typescript\n * field(\"Product\", \"shippingEstimate\", {\n * type: S.Int,\n * directives: [requires({ fields: \"weight dimensions { height width }\" })],\n * resolve: (product) => calculateShipping(product.weight, product.dimensions),\n * })\n * ```\n */\nexport const requires = (config: { fields: string }): FederationDirective => ({\n _tag: \"requires\",\n fields: config.fields,\n})\n\n/**\n * Create a @provides directive\n * Router optimization hint - indicates this field provides additional fields on the returned type\n *\n * @example\n * ```typescript\n * field(\"Review\", \"author\", {\n * type: UserSchema,\n * directives: [provides({ fields: \"name email\" })],\n * resolve: (review) => UserService.findById(review.authorId),\n * })\n * ```\n */\nexport const provides = (config: { fields: string }): FederationDirective => ({\n _tag: \"provides\",\n fields: config.fields,\n})\n\n/**\n * Create an @override directive\n * Transfers resolution responsibility from another subgraph\n *\n * @example\n * ```typescript\n * field(\"Product\", \"price\", {\n * type: S.Number,\n * directives: [override({ from: \"legacy-pricing\" })],\n * resolve: (product) => PricingService.getPrice(product.id),\n * })\n * ```\n */\nexport const override = (config: { from: string; label?: string }): FederationDirective => ({\n _tag: \"override\",\n from: config.from,\n label: config.label,\n})\n","import { Effect } from \"effect\"\nimport * as S from \"effect/Schema\"\nimport type { DirectiveApplication } from \"@effect-gql/core\"\nimport { FederatedSchemaBuilder } from \"./federated-builder\"\nimport type { EntityRegistration } from \"./types\"\n\n// ============================================================================\n// Entity Registration\n// ============================================================================\n\n/**\n * Register an entity type with @key directive(s) and reference resolver.\n *\n * @example\n * ```typescript\n * FederatedSchemaBuilder.empty.pipe(\n * entity({\n * name: \"User\",\n * schema: UserSchema,\n * keys: [key({ fields: \"id\" })],\n * resolveReference: (ref) => UserService.findById(ref.id),\n * }),\n * )\n * ```\n */\nexport const entity =\n <A, R>(config: EntityRegistration<A, R>) =>\n <R2>(builder: FederatedSchemaBuilder<R2>): FederatedSchemaBuilder<R | R2> =>\n builder.entity(config)\n\n// ============================================================================\n// Query/Mutation/Subscription\n// ============================================================================\n\n/**\n * Add a query field\n */\nexport const query =\n <A, E, R, Args = void>(\n name: string,\n config: {\n type: S.Schema<A, any, any>\n args?: S.Schema<Args, any, any>\n description?: string\n directives?: readonly DirectiveApplication[]\n resolve: (args: Args) => Effect.Effect<A, E, R>\n }\n ) =>\n <R2>(builder: FederatedSchemaBuilder<R2>): FederatedSchemaBuilder<R | R2> =>\n builder.query(name, config)\n\n/**\n * Add a mutation field\n */\nexport const mutation =\n <A, E, R, Args = void>(\n name: string,\n config: {\n type: S.Schema<A, any, any>\n args?: S.Schema<Args, any, any>\n description?: string\n directives?: readonly DirectiveApplication[]\n resolve: (args: Args) => Effect.Effect<A, E, R>\n }\n ) =>\n <R2>(builder: FederatedSchemaBuilder<R2>): FederatedSchemaBuilder<R | R2> =>\n builder.mutation(name, config)\n\n/**\n * Add a subscription field\n */\nexport const subscription =\n <A, E, R, Args = void>(\n name: string,\n config: {\n type: S.Schema<A, any, any>\n args?: S.Schema<Args, any, any>\n description?: string\n directives?: readonly DirectiveApplication[]\n subscribe: (args: Args) => Effect.Effect<import(\"effect\").Stream.Stream<A, E, R>, E, R>\n resolve?: (value: A, args: Args) => Effect.Effect<A, E, R>\n }\n ) =>\n <R2>(builder: FederatedSchemaBuilder<R2>): FederatedSchemaBuilder<R | R2> =>\n builder.subscription(name, config)\n\n// ============================================================================\n// Type Registration\n// ============================================================================\n\n/**\n * Register an object type (non-entity)\n */\nexport const objectType =\n <A>(config: {\n name?: string\n schema: S.Schema<A, any, any>\n implements?: readonly string[]\n directives?: readonly DirectiveApplication[]\n }) =>\n <R>(builder: FederatedSchemaBuilder<R>): FederatedSchemaBuilder<R> =>\n builder.objectType(config)\n\n/**\n * Register an interface type\n */\nexport const interfaceType =\n (config: {\n name?: string\n schema: S.Schema<any, any, any>\n resolveType?: (value: any) => string\n directives?: readonly DirectiveApplication[]\n }) =>\n <R>(builder: FederatedSchemaBuilder<R>): FederatedSchemaBuilder<R> =>\n builder.interfaceType(config)\n\n/**\n * Register an enum type\n */\nexport const enumType =\n (config: {\n name: string\n values: readonly string[]\n description?: string\n directives?: readonly DirectiveApplication[]\n }) =>\n <R>(builder: FederatedSchemaBuilder<R>): FederatedSchemaBuilder<R> =>\n builder.enumType(config)\n\n/**\n * Register a union type\n */\nexport const unionType =\n (config: {\n name: string\n types: readonly string[]\n resolveType?: (value: any) => string\n directives?: readonly DirectiveApplication[]\n }) =>\n <R>(builder: FederatedSchemaBuilder<R>): FederatedSchemaBuilder<R> =>\n builder.unionType(config)\n\n/**\n * Register an input type\n */\nexport const inputType =\n (config: {\n name?: string\n schema: S.Schema<any, any, any>\n description?: string\n directives?: readonly DirectiveApplication[]\n }) =>\n <R>(builder: FederatedSchemaBuilder<R>): FederatedSchemaBuilder<R> =>\n builder.inputType(config)\n\n/**\n * Add a computed/relational field to an object type\n */\nexport const field =\n <Parent, A, E, R, Args = void>(\n typeName: string,\n fieldName: string,\n config: {\n type: S.Schema<A, any, any>\n args?: S.Schema<Args, any, any>\n description?: string\n directives?: readonly DirectiveApplication[]\n resolve: (parent: Parent, args: Args) => Effect.Effect<A, E, R>\n }\n ) =>\n <R2>(builder: FederatedSchemaBuilder<R2>): FederatedSchemaBuilder<R | R2> =>\n builder.field(typeName, fieldName, config)\n\n// ============================================================================\n// Field-Level Federation Directive Helpers\n// ============================================================================\n\n/**\n * Create a field configuration with @external directive\n */\nexport const externalField = <A>(config: {\n type: S.Schema<A, any, any>\n description?: string\n}): {\n type: S.Schema<A, any, any>\n description?: string\n directives: readonly DirectiveApplication[]\n resolve: (parent: any) => Effect.Effect<A, never, never>\n} => ({\n type: config.type,\n description: config.description,\n directives: [{ name: \"external\" }],\n resolve: (parent: any) => Effect.succeed(parent),\n})\n\n/**\n * Create a field configuration with @requires directive\n */\nexport const requiresField = <A, E, R, Parent = any>(config: {\n type: S.Schema<A, any, any>\n fields: string\n description?: string\n resolve: (parent: Parent) => Effect.Effect<A, E, R>\n}): {\n type: S.Schema<A, any, any>\n description?: string\n directives: readonly DirectiveApplication[]\n resolve: (parent: Parent) => Effect.Effect<A, E, R>\n} => ({\n type: config.type,\n description: config.description,\n directives: [{ name: \"requires\", args: { fields: config.fields } }],\n resolve: config.resolve,\n})\n\n/**\n * Create a field configuration with @provides directive\n */\nexport const providesField = <A, E, R, Parent = any>(config: {\n type: S.Schema<A, any, any>\n fields: string\n description?: string\n resolve: (parent: Parent) => Effect.Effect<A, E, R>\n}): {\n type: S.Schema<A, any, any>\n description?: string\n directives: readonly DirectiveApplication[]\n resolve: (parent: Parent) => Effect.Effect<A, E, R>\n} => ({\n type: config.type,\n description: config.description,\n directives: [{ name: \"provides\", args: { fields: config.fields } }],\n resolve: config.resolve,\n})\n\n/**\n * Create a field configuration with @override directive\n */\nexport const overrideField = <A, E, R, Parent = any>(config: {\n type: S.Schema<A, any, any>\n from: string\n label?: string\n description?: string\n resolve: (parent: Parent) => Effect.Effect<A, E, R>\n}): {\n type: S.Schema<A, any, any>\n description?: string\n directives: readonly DirectiveApplication[]\n resolve: (parent: Parent) => Effect.Effect<A, E, R>\n} => ({\n type: config.type,\n description: config.description,\n directives: [\n {\n name: \"override\",\n args: {\n from: config.from,\n ...(config.label !== undefined ? { label: config.label } : {}),\n },\n },\n ],\n resolve: config.resolve,\n})\n"]}
package/package.json CHANGED
@@ -1,31 +1,27 @@
1
1
  {
2
2
  "name": "@effect-gql/federation",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "description": "Apollo Federation 2.x support for @effect-gql/core",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
5
+ "repository": {
6
+ "url": "https://github.com/nrf110/effect-gql"
7
+ },
8
+ "type": "module",
9
+ "main": "./index.cjs",
10
+ "module": "dist/index.js",
11
+ "types": "./index.d.ts",
7
12
  "exports": {
8
13
  ".": {
9
- "types": "./dist/index.d.ts",
10
- "default": "./dist/index.js"
14
+ "types": "./index.d.ts",
15
+ "import": "./index.js",
16
+ "require": "./index.cjs"
11
17
  }
12
18
  },
13
- "files": [
14
- "dist",
15
- "src"
16
- ],
17
19
  "peerDependencies": {
18
- "@effect-gql/core": "^0.1.0",
20
+ "@effect-gql/core": "^1.0.0",
19
21
  "@effect/platform": "^0.94.0",
20
22
  "effect": "^3.19.0",
21
23
  "graphql": "^16.0.0"
22
24
  },
23
- "devDependencies": {
24
- "@effect-gql/core": "*",
25
- "@effect/platform": "^0.94.0",
26
- "effect": "^3.19.13",
27
- "graphql": "^16.0.0"
28
- },
29
25
  "keywords": [
30
26
  "effect",
31
27
  "graphql",
@@ -34,14 +30,5 @@
34
30
  "microservices",
35
31
  "subgraph"
36
32
  ],
37
- "license": "MIT",
38
- "scripts": {
39
- "build": "tsc",
40
- "dev": "tsc --watch",
41
- "clean": "rm -rf dist",
42
- "test": "vitest run",
43
- "test:unit": "vitest run test/unit",
44
- "test:integration": "vitest run test/integration",
45
- "test:watch": "vitest"
46
- }
47
- }
33
+ "license": "MIT"
34
+ }
@@ -1,136 +0,0 @@
1
- import type { FederationDirective, KeyDirective } from "./types";
2
- /**
3
- * Create a @key directive for entity identification
4
- *
5
- * @example
6
- * ```typescript
7
- * entity({
8
- * name: "User",
9
- * schema: UserSchema,
10
- * keys: [key({ fields: "id" })],
11
- * resolveReference: (ref) => UserService.findById(ref.id),
12
- * })
13
- * ```
14
- */
15
- export declare const key: (config: KeyDirective) => FederationDirective;
16
- /**
17
- * Create a @shareable directive
18
- * Marks a type or field as resolvable by multiple subgraphs
19
- *
20
- * @example
21
- * ```typescript
22
- * entity({
23
- * name: "Product",
24
- * schema: ProductSchema,
25
- * keys: [key({ fields: "id" })],
26
- * directives: [shareable()],
27
- * })
28
- * ```
29
- */
30
- export declare const shareable: () => FederationDirective;
31
- /**
32
- * Create an @inaccessible directive
33
- * Omits the type/field from the public API while keeping it available for federation
34
- *
35
- * @example
36
- * ```typescript
37
- * objectType({
38
- * name: "InternalMetadata",
39
- * schema: MetadataSchema,
40
- * directives: [inaccessible()],
41
- * })
42
- * ```
43
- */
44
- export declare const inaccessible: () => FederationDirective;
45
- /**
46
- * Create an @interfaceObject directive
47
- * Indicates this object represents an interface from another subgraph
48
- *
49
- * @example
50
- * ```typescript
51
- * objectType({
52
- * name: "Media",
53
- * schema: MediaSchema,
54
- * directives: [interfaceObject()],
55
- * })
56
- * ```
57
- */
58
- export declare const interfaceObject: () => FederationDirective;
59
- /**
60
- * Create a @tag directive for metadata annotation
61
- *
62
- * @example
63
- * ```typescript
64
- * entity({
65
- * name: "Product",
66
- * schema: ProductSchema,
67
- * keys: [key({ fields: "id" })],
68
- * directives: [tag("public"), tag("catalog")],
69
- * })
70
- * ```
71
- */
72
- export declare const tag: (name: string) => FederationDirective;
73
- /**
74
- * Create an @external directive
75
- * Marks a field as defined in another subgraph
76
- *
77
- * @example
78
- * ```typescript
79
- * field("User", "externalId", {
80
- * type: S.String,
81
- * directives: [external()],
82
- * resolve: (parent) => parent.externalId,
83
- * })
84
- * ```
85
- */
86
- export declare const external: () => FederationDirective;
87
- /**
88
- * Create a @requires directive
89
- * Specifies fields that must be fetched from other subgraphs before this field can be resolved
90
- *
91
- * @example
92
- * ```typescript
93
- * field("Product", "shippingEstimate", {
94
- * type: S.Int,
95
- * directives: [requires({ fields: "weight dimensions { height width }" })],
96
- * resolve: (product) => calculateShipping(product.weight, product.dimensions),
97
- * })
98
- * ```
99
- */
100
- export declare const requires: (config: {
101
- fields: string;
102
- }) => FederationDirective;
103
- /**
104
- * Create a @provides directive
105
- * Router optimization hint - indicates this field provides additional fields on the returned type
106
- *
107
- * @example
108
- * ```typescript
109
- * field("Review", "author", {
110
- * type: UserSchema,
111
- * directives: [provides({ fields: "name email" })],
112
- * resolve: (review) => UserService.findById(review.authorId),
113
- * })
114
- * ```
115
- */
116
- export declare const provides: (config: {
117
- fields: string;
118
- }) => FederationDirective;
119
- /**
120
- * Create an @override directive
121
- * Transfers resolution responsibility from another subgraph
122
- *
123
- * @example
124
- * ```typescript
125
- * field("Product", "price", {
126
- * type: S.Number,
127
- * directives: [override({ from: "legacy-pricing" })],
128
- * resolve: (product) => PricingService.getPrice(product.id),
129
- * })
130
- * ```
131
- */
132
- export declare const override: (config: {
133
- from: string;
134
- label?: string;
135
- }) => FederationDirective;
136
- //# sourceMappingURL=directives.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../src/directives.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAMhE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,GAAG,GAAI,QAAQ,YAAY,KAAG,mBAIzC,CAAA;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,SAAS,QAAO,mBAE3B,CAAA;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,QAAO,mBAE9B,CAAA;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,QAAO,mBAEjC,CAAA;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,GAAG,GAAI,MAAM,MAAM,KAAG,mBAGjC,CAAA;AAMF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,QAAO,mBAE1B,CAAA;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,GAAI,QAAQ;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,KAAG,mBAGpD,CAAA;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,GAAI,QAAQ;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,KAAG,mBAGpD,CAAA;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,GAAI,QAAQ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,KAAG,mBAIlE,CAAA"}
@@ -1,171 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.override = exports.provides = exports.requires = exports.external = exports.tag = exports.interfaceObject = exports.inaccessible = exports.shareable = exports.key = void 0;
4
- // ============================================================================
5
- // Type-Level Directive Factories
6
- // ============================================================================
7
- /**
8
- * Create a @key directive for entity identification
9
- *
10
- * @example
11
- * ```typescript
12
- * entity({
13
- * name: "User",
14
- * schema: UserSchema,
15
- * keys: [key({ fields: "id" })],
16
- * resolveReference: (ref) => UserService.findById(ref.id),
17
- * })
18
- * ```
19
- */
20
- const key = (config) => ({
21
- _tag: "key",
22
- fields: config.fields,
23
- resolvable: config.resolvable,
24
- });
25
- exports.key = key;
26
- /**
27
- * Create a @shareable directive
28
- * Marks a type or field as resolvable by multiple subgraphs
29
- *
30
- * @example
31
- * ```typescript
32
- * entity({
33
- * name: "Product",
34
- * schema: ProductSchema,
35
- * keys: [key({ fields: "id" })],
36
- * directives: [shareable()],
37
- * })
38
- * ```
39
- */
40
- const shareable = () => ({
41
- _tag: "shareable",
42
- });
43
- exports.shareable = shareable;
44
- /**
45
- * Create an @inaccessible directive
46
- * Omits the type/field from the public API while keeping it available for federation
47
- *
48
- * @example
49
- * ```typescript
50
- * objectType({
51
- * name: "InternalMetadata",
52
- * schema: MetadataSchema,
53
- * directives: [inaccessible()],
54
- * })
55
- * ```
56
- */
57
- const inaccessible = () => ({
58
- _tag: "inaccessible",
59
- });
60
- exports.inaccessible = inaccessible;
61
- /**
62
- * Create an @interfaceObject directive
63
- * Indicates this object represents an interface from another subgraph
64
- *
65
- * @example
66
- * ```typescript
67
- * objectType({
68
- * name: "Media",
69
- * schema: MediaSchema,
70
- * directives: [interfaceObject()],
71
- * })
72
- * ```
73
- */
74
- const interfaceObject = () => ({
75
- _tag: "interfaceObject",
76
- });
77
- exports.interfaceObject = interfaceObject;
78
- /**
79
- * Create a @tag directive for metadata annotation
80
- *
81
- * @example
82
- * ```typescript
83
- * entity({
84
- * name: "Product",
85
- * schema: ProductSchema,
86
- * keys: [key({ fields: "id" })],
87
- * directives: [tag("public"), tag("catalog")],
88
- * })
89
- * ```
90
- */
91
- const tag = (name) => ({
92
- _tag: "tag",
93
- name,
94
- });
95
- exports.tag = tag;
96
- // ============================================================================
97
- // Field-Level Directive Factories
98
- // ============================================================================
99
- /**
100
- * Create an @external directive
101
- * Marks a field as defined in another subgraph
102
- *
103
- * @example
104
- * ```typescript
105
- * field("User", "externalId", {
106
- * type: S.String,
107
- * directives: [external()],
108
- * resolve: (parent) => parent.externalId,
109
- * })
110
- * ```
111
- */
112
- const external = () => ({
113
- _tag: "external",
114
- });
115
- exports.external = external;
116
- /**
117
- * Create a @requires directive
118
- * Specifies fields that must be fetched from other subgraphs before this field can be resolved
119
- *
120
- * @example
121
- * ```typescript
122
- * field("Product", "shippingEstimate", {
123
- * type: S.Int,
124
- * directives: [requires({ fields: "weight dimensions { height width }" })],
125
- * resolve: (product) => calculateShipping(product.weight, product.dimensions),
126
- * })
127
- * ```
128
- */
129
- const requires = (config) => ({
130
- _tag: "requires",
131
- fields: config.fields,
132
- });
133
- exports.requires = requires;
134
- /**
135
- * Create a @provides directive
136
- * Router optimization hint - indicates this field provides additional fields on the returned type
137
- *
138
- * @example
139
- * ```typescript
140
- * field("Review", "author", {
141
- * type: UserSchema,
142
- * directives: [provides({ fields: "name email" })],
143
- * resolve: (review) => UserService.findById(review.authorId),
144
- * })
145
- * ```
146
- */
147
- const provides = (config) => ({
148
- _tag: "provides",
149
- fields: config.fields,
150
- });
151
- exports.provides = provides;
152
- /**
153
- * Create an @override directive
154
- * Transfers resolution responsibility from another subgraph
155
- *
156
- * @example
157
- * ```typescript
158
- * field("Product", "price", {
159
- * type: S.Number,
160
- * directives: [override({ from: "legacy-pricing" })],
161
- * resolve: (product) => PricingService.getPrice(product.id),
162
- * })
163
- * ```
164
- */
165
- const override = (config) => ({
166
- _tag: "override",
167
- from: config.from,
168
- label: config.label,
169
- });
170
- exports.override = override;
171
- //# sourceMappingURL=directives.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"directives.js","sourceRoot":"","sources":["../src/directives.ts"],"names":[],"mappings":";;;AAEA,+EAA+E;AAC/E,iCAAiC;AACjC,+EAA+E;AAE/E;;;;;;;;;;;;GAYG;AACI,MAAM,GAAG,GAAG,CAAC,MAAoB,EAAuB,EAAE,CAAC,CAAC;IACjE,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,UAAU,EAAE,MAAM,CAAC,UAAU;CAC9B,CAAC,CAAA;AAJW,QAAA,GAAG,OAId;AAEF;;;;;;;;;;;;;GAaG;AACI,MAAM,SAAS,GAAG,GAAwB,EAAE,CAAC,CAAC;IACnD,IAAI,EAAE,WAAW;CAClB,CAAC,CAAA;AAFW,QAAA,SAAS,aAEpB;AAEF;;;;;;;;;;;;GAYG;AACI,MAAM,YAAY,GAAG,GAAwB,EAAE,CAAC,CAAC;IACtD,IAAI,EAAE,cAAc;CACrB,CAAC,CAAA;AAFW,QAAA,YAAY,gBAEvB;AAEF;;;;;;;;;;;;GAYG;AACI,MAAM,eAAe,GAAG,GAAwB,EAAE,CAAC,CAAC;IACzD,IAAI,EAAE,iBAAiB;CACxB,CAAC,CAAA;AAFW,QAAA,eAAe,mBAE1B;AAEF;;;;;;;;;;;;GAYG;AACI,MAAM,GAAG,GAAG,CAAC,IAAY,EAAuB,EAAE,CAAC,CAAC;IACzD,IAAI,EAAE,KAAK;IACX,IAAI;CACL,CAAC,CAAA;AAHW,QAAA,GAAG,OAGd;AAEF,+EAA+E;AAC/E,kCAAkC;AAClC,+EAA+E;AAE/E;;;;;;;;;;;;GAYG;AACI,MAAM,QAAQ,GAAG,GAAwB,EAAE,CAAC,CAAC;IAClD,IAAI,EAAE,UAAU;CACjB,CAAC,CAAA;AAFW,QAAA,QAAQ,YAEnB;AAEF;;;;;;;;;;;;GAYG;AACI,MAAM,QAAQ,GAAG,CAAC,MAA0B,EAAuB,EAAE,CAAC,CAAC;IAC5E,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,MAAM,CAAC,MAAM;CACtB,CAAC,CAAA;AAHW,QAAA,QAAQ,YAGnB;AAEF;;;;;;;;;;;;GAYG;AACI,MAAM,QAAQ,GAAG,CAAC,MAA0B,EAAuB,EAAE,CAAC,CAAC;IAC5E,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,MAAM,CAAC,MAAM;CACtB,CAAC,CAAA;AAHW,QAAA,QAAQ,YAGnB;AAEF;;;;;;;;;;;;GAYG;AACI,MAAM,QAAQ,GAAG,CAAC,MAAwC,EAAuB,EAAE,CAAC,CAAC;IAC1F,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,MAAM,CAAC,IAAI;IACjB,KAAK,EAAE,MAAM,CAAC,KAAK;CACpB,CAAC,CAAA;AAJW,QAAA,QAAQ,YAInB"}
@@ -1,31 +0,0 @@
1
- import { Runtime } from "effect";
2
- import { GraphQLObjectType, GraphQLUnionType } from "@effect-gql/core";
3
- import type { EntityRegistration, EntityRepresentation } from "./types";
4
- /**
5
- * Create the _Entity union type from registered entities
6
- */
7
- export declare function createEntityUnion(entities: Map<string, EntityRegistration<any, any>>, typeRegistry: Map<string, GraphQLObjectType>): GraphQLUnionType;
8
- /**
9
- * Create the _entities resolver
10
- *
11
- * This resolver receives an array of representations (objects with __typename and key fields)
12
- * and returns the corresponding entities by calling each entity's resolveReference function.
13
- *
14
- * Uses Effect.all with unbounded concurrency to resolve all entities in parallel.
15
- */
16
- export declare function createEntitiesResolver<R>(entities: Map<string, EntityRegistration<any, R>>): (_parent: any, args: {
17
- representations: readonly EntityRepresentation[];
18
- }, context: {
19
- runtime: Runtime.Runtime<R>;
20
- }) => Promise<(any | null)[]>;
21
- /**
22
- * Create the _Service type for SDL introspection
23
- */
24
- export declare function createServiceType(): GraphQLObjectType;
25
- /**
26
- * Create the _service resolver
27
- */
28
- export declare function createServiceResolver(sdl: string): () => {
29
- sdl: string;
30
- };
31
- //# sourceMappingURL=entities.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../src/entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,OAAO,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAiB,MAAM,kBAAkB,CAAA;AACrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEvE;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EACnD,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAC3C,gBAAgB,CAelB;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAEvF,SAAS,GAAG,EACZ,MAAM;IAAE,eAAe,EAAE,SAAS,oBAAoB,EAAE,CAAA;CAAE,EAC1D,SAAS;IAAE,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;CAAE,KACvC,OAAO,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,CA0B3B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,iBAAiB,CAWrD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM;;EAEhD"}
package/dist/entities.js DELETED
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createEntityUnion = createEntityUnion;
4
- exports.createEntitiesResolver = createEntitiesResolver;
5
- exports.createServiceType = createServiceType;
6
- exports.createServiceResolver = createServiceResolver;
7
- const effect_1 = require("effect");
8
- const core_1 = require("@effect-gql/core");
9
- /**
10
- * Create the _Entity union type from registered entities
11
- */
12
- function createEntityUnion(entities, typeRegistry) {
13
- const types = Array.from(entities.keys())
14
- .map((name) => typeRegistry.get(name))
15
- .filter(Boolean);
16
- if (types.length === 0) {
17
- throw new Error("At least one entity must be registered to create _Entity union");
18
- }
19
- return new core_1.GraphQLUnionType({
20
- name: "_Entity",
21
- description: "Union of all types that have @key directives",
22
- types: () => types,
23
- resolveType: (value) => value.__typename,
24
- });
25
- }
26
- /**
27
- * Create the _entities resolver
28
- *
29
- * This resolver receives an array of representations (objects with __typename and key fields)
30
- * and returns the corresponding entities by calling each entity's resolveReference function.
31
- *
32
- * Uses Effect.all with unbounded concurrency to resolve all entities in parallel.
33
- */
34
- function createEntitiesResolver(entities) {
35
- return async (_parent, args, context) => {
36
- const effects = args.representations.map((representation) => {
37
- const entityName = representation.__typename;
38
- const entity = entities.get(entityName);
39
- if (!entity) {
40
- return effect_1.Effect.fail(new Error(`Unknown entity type: ${entityName}`));
41
- }
42
- return entity.resolveReference(representation).pipe(effect_1.Effect.map((result) => {
43
- // Add __typename to the result for union type resolution
44
- if (result !== null && typeof result === "object") {
45
- return { ...result, __typename: entityName };
46
- }
47
- return result;
48
- }),
49
- // Catch individual entity resolution errors and return null
50
- effect_1.Effect.catchAll((error) => effect_1.Effect.logError(`Failed to resolve entity ${entityName}`, error).pipe(effect_1.Effect.as(null))));
51
- });
52
- return effect_1.Runtime.runPromise(context.runtime)(effect_1.Effect.all(effects, { concurrency: "unbounded" }));
53
- };
54
- }
55
- /**
56
- * Create the _Service type for SDL introspection
57
- */
58
- function createServiceType() {
59
- return new core_1.GraphQLObjectType({
60
- name: "_Service",
61
- description: "Provides SDL for the subgraph schema",
62
- fields: {
63
- sdl: {
64
- type: core_1.GraphQLString,
65
- description: "The SDL representing the subgraph schema",
66
- },
67
- },
68
- });
69
- }
70
- /**
71
- * Create the _service resolver
72
- */
73
- function createServiceResolver(sdl) {
74
- return () => ({ sdl });
75
- }
76
- //# sourceMappingURL=entities.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entities.js","sourceRoot":"","sources":["../src/entities.ts"],"names":[],"mappings":";;AAOA,8CAkBC;AAUD,wDA+BC;AAKD,8CAWC;AAKD,sDAEC;AAzFD,mCAAwC;AACxC,2CAAqF;AAGrF;;GAEG;AACH,SAAgB,iBAAiB,CAC/B,QAAmD,EACnD,YAA4C;IAE5C,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;SACtC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;SACtC,MAAM,CAAC,OAAO,CAAC,CAAA;IAElB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAA;IACnF,CAAC;IAED,OAAO,IAAI,uBAAgB,CAAC;QAC1B,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,8CAA8C;QAC3D,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK;QAClB,WAAW,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU;KAC9C,CAAC,CAAA;AACJ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