Initialisation

Added the packages and files for the backend server
This commit is contained in:
jackbeeby
2024-12-15 17:48:45 +11:00
parent 25066e1ee8
commit b412dfe2ca
2732 changed files with 330572 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import { GraphQLSchema } from 'graphql';
import { IAddResolversToSchemaOptions } from '@graphql-tools/utils';
export declare function addResolversToSchema({ schema, resolvers: inputResolvers, defaultFieldResolver, resolverValidationOptions, inheritResolversFromInterfaces, updateResolversInPlace, }: IAddResolversToSchemaOptions): GraphQLSchema;

View File

@@ -0,0 +1,3 @@
import { GraphQLSchema } from 'graphql';
import { IAddResolversToSchemaOptions } from '@graphql-tools/utils';
export declare function addResolversToSchema({ schema, resolvers: inputResolvers, defaultFieldResolver, resolverValidationOptions, inheritResolversFromInterfaces, updateResolversInPlace, }: IAddResolversToSchemaOptions): GraphQLSchema;

View File

@@ -0,0 +1,3 @@
import { GraphQLSchema } from 'graphql';
import { IResolverValidationOptions } from '@graphql-tools/utils';
export declare function assertResolversPresent(schema: GraphQLSchema, resolverValidationOptions?: IResolverValidationOptions): void;

View File

@@ -0,0 +1,3 @@
import { GraphQLSchema } from 'graphql';
import { IResolverValidationOptions } from '@graphql-tools/utils';
export declare function assertResolversPresent(schema: GraphQLSchema, resolverValidationOptions?: IResolverValidationOptions): void;

View File

@@ -0,0 +1,5 @@
import { GraphQLResolveInfo, GraphQLFieldResolver } from 'graphql';
import { Maybe } from '@graphql-tools/utils';
export declare function chainResolvers<TArgs extends {
[argName: string]: any;
}>(resolvers: Array<Maybe<GraphQLFieldResolver<any, any, TArgs>>>): (root: any, args: TArgs, ctx: any, info: GraphQLResolveInfo) => any;

View File

@@ -0,0 +1,5 @@
import { GraphQLResolveInfo, GraphQLFieldResolver } from 'graphql';
import { Maybe } from '@graphql-tools/utils';
export declare function chainResolvers<TArgs extends {
[argName: string]: any;
}>(resolvers: Array<Maybe<GraphQLFieldResolver<any, any, TArgs>>>): (root: any, args: TArgs, ctx: any, info: GraphQLResolveInfo) => any;

View File

@@ -0,0 +1,3 @@
import { GraphQLSchema } from 'graphql';
import { ValidatorBehavior } from '@graphql-tools/utils';
export declare function checkForResolveTypeResolver(schema: GraphQLSchema, requireResolversForResolveType?: ValidatorBehavior): void;

View File

@@ -0,0 +1,3 @@
import { GraphQLSchema } from 'graphql';
import { ValidatorBehavior } from '@graphql-tools/utils';
export declare function checkForResolveTypeResolver(schema: GraphQLSchema, requireResolversForResolveType?: ValidatorBehavior): void;

View File

@@ -0,0 +1,3 @@
import { GraphQLSchema } from 'graphql';
import { IResolvers } from '@graphql-tools/utils';
export declare function extendResolversFromInterfaces(schema: GraphQLSchema, resolvers: IResolvers): IResolvers;

View File

@@ -0,0 +1,3 @@
import { GraphQLSchema } from 'graphql';
import { IResolvers } from '@graphql-tools/utils';
export declare function extendResolversFromInterfaces(schema: GraphQLSchema, resolvers: IResolvers): IResolvers;

View File

@@ -0,0 +1,9 @@
export { assertResolversPresent } from './assertResolversPresent.cjs';
export { chainResolvers } from './chainResolvers.cjs';
export { addResolversToSchema } from './addResolversToSchema.cjs';
export { checkForResolveTypeResolver } from './checkForResolveTypeResolver.cjs';
export { extendResolversFromInterfaces } from './extendResolversFromInterfaces.cjs';
export * from './makeExecutableSchema.cjs';
export * from './types.cjs';
export * from './merge-schemas.cjs';
export { extractExtensionsFromSchema } from '@graphql-tools/utils';

View File

@@ -0,0 +1,9 @@
export { assertResolversPresent } from './assertResolversPresent.js';
export { chainResolvers } from './chainResolvers.js';
export { addResolversToSchema } from './addResolversToSchema.js';
export { checkForResolveTypeResolver } from './checkForResolveTypeResolver.js';
export { extendResolversFromInterfaces } from './extendResolversFromInterfaces.js';
export * from './makeExecutableSchema.js';
export * from './types.js';
export * from './merge-schemas.js';
export { extractExtensionsFromSchema } from '@graphql-tools/utils';

View File

@@ -0,0 +1,46 @@
import { GraphQLSchema } from 'graphql';
import { IExecutableSchemaDefinition } from './types.cjs';
/**
* Builds a schema from the provided type definitions and resolvers.
*
* The type definitions are written using Schema Definition Language (SDL). They
* can be provided as a string, a `DocumentNode`, a function, or an array of any
* of these. If a function is provided, it will be passed no arguments and
* should return an array of strings or `DocumentNode`s.
*
* Note: You can use GraphQL magic comment provide additional syntax
* highlighting in your editor (with the appropriate editor plugin).
*
* ```js
* const typeDefs = /* GraphQL *\/ `
* type Query {
* posts: [Post]
* author(id: Int!): Author
* }
* `;
* ```
*
* The `resolvers` object should be a map of type names to nested object, which
* themselves map the type's fields to their appropriate resolvers.
* See the [Resolvers](/docs/resolvers) section of the documentation for more details.
*
* ```js
* const resolvers = {
* Query: {
* posts: (obj, args, ctx, info) => getAllPosts(),
* author: (obj, args, ctx, info) => getAuthorById(args.id)
* }
* };
* ```
*
* Once you've defined both the `typeDefs` and `resolvers`, you can create your
* schema:
*
* ```js
* const schema = makeExecutableSchema({
* typeDefs,
* resolvers,
* })
* ```
*/
export declare function makeExecutableSchema<TContext = any>({ typeDefs, resolvers, resolverValidationOptions, inheritResolversFromInterfaces, updateResolversInPlace, schemaExtensions, ...otherOptions }: IExecutableSchemaDefinition<TContext>): GraphQLSchema;

View File

@@ -0,0 +1,46 @@
import { GraphQLSchema } from 'graphql';
import { IExecutableSchemaDefinition } from './types.js';
/**
* Builds a schema from the provided type definitions and resolvers.
*
* The type definitions are written using Schema Definition Language (SDL). They
* can be provided as a string, a `DocumentNode`, a function, or an array of any
* of these. If a function is provided, it will be passed no arguments and
* should return an array of strings or `DocumentNode`s.
*
* Note: You can use GraphQL magic comment provide additional syntax
* highlighting in your editor (with the appropriate editor plugin).
*
* ```js
* const typeDefs = /* GraphQL *\/ `
* type Query {
* posts: [Post]
* author(id: Int!): Author
* }
* `;
* ```
*
* The `resolvers` object should be a map of type names to nested object, which
* themselves map the type's fields to their appropriate resolvers.
* See the [Resolvers](/docs/resolvers) section of the documentation for more details.
*
* ```js
* const resolvers = {
* Query: {
* posts: (obj, args, ctx, info) => getAllPosts(),
* author: (obj, args, ctx, info) => getAuthorById(args.id)
* }
* };
* ```
*
* Once you've defined both the `typeDefs` and `resolvers`, you can create your
* schema:
*
* ```js
* const schema = makeExecutableSchema({
* typeDefs,
* resolvers,
* })
* ```
*/
export declare function makeExecutableSchema<TContext = any>({ typeDefs, resolvers, resolverValidationOptions, inheritResolversFromInterfaces, updateResolversInPlace, schemaExtensions, ...otherOptions }: IExecutableSchemaDefinition<TContext>): GraphQLSchema;

View File

@@ -0,0 +1,16 @@
import { GraphQLSchema } from 'graphql';
import { IExecutableSchemaDefinition } from './types.cjs';
/**
* Configuration object for schema merging
*/
export type MergeSchemasConfig<T = any> = Partial<IExecutableSchemaDefinition<T>> & {
/**
* The schemas to be merged
*/
schemas?: GraphQLSchema[];
};
/**
* Synchronously merges multiple schemas, typeDefinitions and/or resolvers into a single schema.
* @param config Configuration object
*/
export declare function mergeSchemas(config: MergeSchemasConfig): GraphQLSchema;

View File

@@ -0,0 +1,16 @@
import { GraphQLSchema } from 'graphql';
import { IExecutableSchemaDefinition } from './types.js';
/**
* Configuration object for schema merging
*/
export type MergeSchemasConfig<T = any> = Partial<IExecutableSchemaDefinition<T>> & {
/**
* The schemas to be merged
*/
schemas?: GraphQLSchema[];
};
/**
* Synchronously merges multiple schemas, typeDefinitions and/or resolvers into a single schema.
* @param config Configuration object
*/
export declare function mergeSchemas(config: MergeSchemasConfig): GraphQLSchema;

35
node_modules/@graphql-tools/schema/typings/types.d.cts generated vendored Normal file
View File

@@ -0,0 +1,35 @@
import { TypeSource, IResolvers, IResolverValidationOptions, GraphQLParseOptions, SchemaExtensions } from '@graphql-tools/utils';
import { BuildSchemaOptions, GraphQLSchema } from 'graphql';
export interface GraphQLSchemaWithContext<TContext> extends GraphQLSchema {
__context?: TContext;
}
/**
* Configuration object for creating an executable schema
*/
export interface IExecutableSchemaDefinition<TContext = any> extends BuildSchemaOptions, GraphQLParseOptions {
/**
* The type definitions used to create the schema
*/
typeDefs: TypeSource;
/**
* Object describing the field resolvers for the provided type definitions
*/
resolvers?: IResolvers<any, TContext> | Array<IResolvers<any, TContext>>;
/**
* Additional options for validating the provided resolvers
*/
resolverValidationOptions?: IResolverValidationOptions;
/**
* GraphQL object types that implement interfaces will inherit any missing
* resolvers from their interface types defined in the `resolvers` object
*/
inheritResolversFromInterfaces?: boolean;
/**
* Do not create a schema again and use the one from `buildASTSchema`
*/
updateResolversInPlace?: boolean;
/**
* Schema extensions
*/
schemaExtensions?: SchemaExtensions | Array<SchemaExtensions>;
}

35
node_modules/@graphql-tools/schema/typings/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,35 @@
import { TypeSource, IResolvers, IResolverValidationOptions, GraphQLParseOptions, SchemaExtensions } from '@graphql-tools/utils';
import { BuildSchemaOptions, GraphQLSchema } from 'graphql';
export interface GraphQLSchemaWithContext<TContext> extends GraphQLSchema {
__context?: TContext;
}
/**
* Configuration object for creating an executable schema
*/
export interface IExecutableSchemaDefinition<TContext = any> extends BuildSchemaOptions, GraphQLParseOptions {
/**
* The type definitions used to create the schema
*/
typeDefs: TypeSource;
/**
* Object describing the field resolvers for the provided type definitions
*/
resolvers?: IResolvers<any, TContext> | Array<IResolvers<any, TContext>>;
/**
* Additional options for validating the provided resolvers
*/
resolverValidationOptions?: IResolverValidationOptions;
/**
* GraphQL object types that implement interfaces will inherit any missing
* resolvers from their interface types defined in the `resolvers` object
*/
inheritResolversFromInterfaces?: boolean;
/**
* Do not create a schema again and use the one from `buildASTSchema`
*/
updateResolversInPlace?: boolean;
/**
* Schema extensions
*/
schemaExtensions?: SchemaExtensions | Array<SchemaExtensions>;
}