Skip to content

Commit

Permalink
version and scalars
Browse files Browse the repository at this point in the history
  • Loading branch information
aexol committed Aug 5, 2024
1 parent 41d2960 commit dd4e444
Show file tree
Hide file tree
Showing 40 changed files with 289 additions and 617 deletions.
7 changes: 5 additions & 2 deletions adapters/apollo-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { GraphQLSchema } from 'graphql';
type SchemaMapperInitial = Required<Parameters<typeof mapSchema>>[1];
export type SchemaMapper = (schema: GraphQLSchema, getDirective: typeof getDirectiveFn) => SchemaMapperInitial;
export const apolloServerAdapter = AxolotlAdapter<[any, any, any, any], SchemaMapper>()((
{ resolvers, directives },
{ resolvers, directives, scalars },
options?: {
schema?: {
file?: { path: string } | { content: string };
Expand Down Expand Up @@ -43,7 +43,10 @@ export const apolloServerAdapter = AxolotlAdapter<[any, any, any, any], SchemaMa

let apolloSchema = makeExecutableSchema({
typeDefs: schema,
resolvers: apolloResolvers,
resolvers: {
...apolloResolvers,
...scalars,
},
});

if (directives) {
Expand Down
4 changes: 2 additions & 2 deletions adapters/apollo-server/package-lock.json

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

4 changes: 2 additions & 2 deletions adapters/apollo-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aexol/axolotl-apollo-server",
"version": "0.4.5",
"version": "0.5.0",
"private": false,
"main": "./lib/index.js",
"author": "Aexol, Artur Czemiel",
Expand All @@ -14,7 +14,7 @@
"lib"
],
"dependencies": {
"@aexol/axolotl-core": "^0.4.5",
"@aexol/axolotl-core": "^0.5.0",
"@apollo/server": "^4.9.4",
"@graphql-tools/schema": "^9.0.19",
"@graphql-tools/utils": "^9.2.1"
Expand Down
7 changes: 5 additions & 2 deletions adapters/graphql-yoga/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type SchemaMapper = (
) => SchemaMapperInitial;

export const graphqlYogaAdapter = AxolotlAdapter<[any, any, YogaInitialContext], SchemaMapper>()((
{ resolvers, directives },
{ resolvers, directives, scalars },
options?: {
yoga?: Parameters<typeof createYoga>[0];
schema?: {
Expand Down Expand Up @@ -48,7 +48,10 @@ export const graphqlYogaAdapter = AxolotlAdapter<[any, any, YogaInitialContext],
let yogaSchema = createSchema({
...options?.schema?.options,
typeDefs: schema,
resolvers: yogaResolvers,
resolvers: {
...yogaResolvers,
...scalars,
},
});

if (directives) {
Expand Down
4 changes: 2 additions & 2 deletions adapters/graphql-yoga/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aexol/axolotl-graphql-yoga",
"version": "0.4.5",
"version": "0.5.0",
"private": false,
"main": "./lib/index.js",
"author": "Aexol, Artur Czemiel",
Expand All @@ -14,7 +14,7 @@
"lib"
],
"dependencies": {
"@aexol/axolotl-core": "^0.4.5",
"@aexol/axolotl-core": "^0.5.0",
"@graphql-tools/utils": "^10.3.2",
"graphql-yoga": "^4.0.5"
},
Expand Down
5 changes: 0 additions & 5 deletions adapters/stucco/.eslintrc.json

This file was deleted.

4 changes: 0 additions & 4 deletions adapters/stucco/.gitignore

This file was deleted.

66 changes: 0 additions & 66 deletions adapters/stucco/index.ts

This file was deleted.

10 changes: 0 additions & 10 deletions adapters/stucco/jest.config.js

This file was deleted.

20 changes: 0 additions & 20 deletions adapters/stucco/package.json

This file was deleted.

44 changes: 0 additions & 44 deletions adapters/stucco/tsconfig.json

This file was deleted.

1 change: 0 additions & 1 deletion deno.lock

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

36 changes: 0 additions & 36 deletions docs/pages/adapters/stucco.mdx

This file was deleted.

3 changes: 3 additions & 0 deletions docs/pages/scalars.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Custom scalars

Custom scalar resolvers work like any other resolvers
8 changes: 4 additions & 4 deletions examples/beerpub-apollo-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "beerpub-apollo-server",
"version": "0.4.5",
"version": "0.5.0",
"description": "Automatically generated by graphql-editor-cli",
"main": "lib/index.js",
"type": "module",
Expand All @@ -17,15 +17,15 @@
"author": "GraphQL Editor Centaur Generator",
"license": "ISC",
"dependencies": {
"@aexol/axolotl-apollo-server": "^0.4.5",
"@aexol/axolotl-core": "^0.4.5",
"@aexol/axolotl-apollo-server": "^0.5.0",
"@aexol/axolotl-core": "^0.5.0",
"@apollo/server": "^4.9.4",
"graphql": "^16.8.1",
"node-fetch": "^3.2.10",
"ws": "^8.12.0"
},
"devDependencies": {
"@aexol/axolotl": "^0.4.5",
"@aexol/axolotl": "^0.5.0",
"@types/node": "^18.7.18",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/beerpub-apollo-server/src/axolotl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { Models } from "@/src/models.js";
import { Axolotl } from "@aexol/axolotl-core";
import { apolloServerAdapter } from "@aexol/axolotl-apollo-server";

export const { applyMiddleware, createResolvers, adapter } = Axolotl(apolloServerAdapter)<Models,{}>();
export const { applyMiddleware, createResolvers, adapter } = Axolotl(apolloServerAdapter)<Models>();

8 changes: 4 additions & 4 deletions examples/beerpub-yoga-federated/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "beerpub-yoga-federated",
"version": "0.5.5",
"version": "0.6.0",
"description": "Automatically generated by graphql-editor-cli",
"main": "lib/index.js",
"type": "module",
Expand All @@ -20,15 +20,15 @@
"author": "GraphQL Editor Centaur Generator",
"license": "ISC",
"dependencies": {
"@aexol/axolotl-core": "^0.4.5",
"@aexol/axolotl-graphql-yoga": "^0.4.5",
"@aexol/axolotl-core": "^0.5.0",
"@aexol/axolotl-graphql-yoga": "^0.5.0",
"graphql": "^16.8.1",
"graphql-yoga": "^4.0.5",
"node-fetch": "^3.2.10",
"ws": "^8.12.0"
},
"devDependencies": {
"@aexol/axolotl": "^0.4.5",
"@aexol/axolotl": "^0.5.0",
"@types/node": "^18.7.18",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
Expand Down
5 changes: 1 addition & 4 deletions examples/beerpub-yoga-federated/src/axolotl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@ import { Models } from '@/src/models.js';
import { Axolotl } from '@aexol/axolotl-core';
import { graphqlYogaAdapter } from '@aexol/axolotl-graphql-yoga';

export const { applyMiddleware, createResolvers, createDirectives, adapter } = Axolotl(graphqlYogaAdapter)<
Models,
unknown
>();
export const { applyMiddleware, createResolvers, createDirectives, adapter } = Axolotl(graphqlYogaAdapter)<Models>();
27 changes: 0 additions & 27 deletions examples/beerpub-yoga/beers.json

This file was deleted.

Loading

0 comments on commit dd4e444

Please sign in to comment.