Skip to content

Commit

Permalink
unions support
Browse files Browse the repository at this point in the history
  • Loading branch information
aexol committed Aug 7, 2024
1 parent dd4e444 commit 125fa9d
Show file tree
Hide file tree
Showing 16 changed files with 124 additions and 62 deletions.
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.5.0",
"version": "0.5.1",
"private": false,
"main": "./lib/index.js",
"author": "Aexol, Artur Czemiel",
Expand All @@ -14,7 +14,7 @@
"lib"
],
"dependencies": {
"@aexol/axolotl-core": "^0.5.0",
"@aexol/axolotl-core": "^0.5.1",
"@apollo/server": "^4.9.4",
"@graphql-tools/schema": "^9.0.19",
"@graphql-tools/utils": "^9.2.1"
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.5.0",
"version": "0.5.1",
"private": false,
"main": "./lib/index.js",
"author": "Aexol, Artur Czemiel",
Expand All @@ -14,7 +14,7 @@
"lib"
],
"dependencies": {
"@aexol/axolotl-core": "^0.5.0",
"@aexol/axolotl-core": "^0.5.1",
"@graphql-tools/utils": "^10.3.2",
"graphql-yoga": "^4.0.5"
},
Expand Down
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.5.0",
"version": "0.5.1",
"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.5.0",
"@aexol/axolotl-core": "^0.5.0",
"@aexol/axolotl-apollo-server": "^0.5.1",
"@aexol/axolotl-core": "^0.5.1",
"@apollo/server": "^4.9.4",
"graphql": "^16.8.1",
"node-fetch": "^3.2.10",
"ws": "^8.12.0"
},
"devDependencies": {
"@aexol/axolotl": "^0.5.0",
"@aexol/axolotl": "^0.5.1",
"@types/node": "^18.7.18",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
Expand Down
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.6.0",
"version": "0.6.1",
"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.5.0",
"@aexol/axolotl-graphql-yoga": "^0.5.0",
"@aexol/axolotl-core": "^0.5.1",
"@aexol/axolotl-graphql-yoga": "^0.5.1",
"graphql": "^16.8.1",
"graphql-yoga": "^4.0.5",
"node-fetch": "^3.2.10",
"ws": "^8.12.0"
},
"devDependencies": {
"@aexol/axolotl": "^0.5.0",
"@aexol/axolotl": "^0.5.1",
"@types/node": "^18.7.18",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
Expand Down
8 changes: 4 additions & 4 deletions examples/beerpub-yoga/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "beerpub-yoga",
"version": "0.6.0",
"version": "0.6.1",
"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.5.0",
"@aexol/axolotl-graphql-yoga": "^0.5.0",
"@aexol/axolotl-core": "^0.5.1",
"@aexol/axolotl-graphql-yoga": "^0.5.1",
"graphql": "^16.8.1",
"graphql-yoga": "^5.6.3",
"node-fetch": "^3.2.10",
"ws": "^8.12.0"
},
"devDependencies": {
"@aexol/axolotl": "^0.5.0",
"@aexol/axolotl": "^0.5.1",
"@types/node": "^18.7.18",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
Expand Down
17 changes: 17 additions & 0 deletions examples/beerpub-yoga/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@ type Beer implements Node{
createdAt: String!
info:String
url: URL
genre: BeerGenre
}

type Chips implements Node{
_id: String!
createdAt: String!
name: String!
price: Int!
}

type Query{
beers: [Beer!]
products: [Product!]
testAuth: String! @auth
}

Expand All @@ -29,6 +38,7 @@ input CreateBeer{
name: String!
price: Int!
url: URL
genre: BeerGenre
}

interface Node{
Expand All @@ -47,6 +57,13 @@ schema{
mutation: Mutation
}

union Product = Beer | Chips

enum BeerGenre{
IPA
LAGER
PORTER
}

scalar URL
directive @auth on FIELD_DEFINITION
37 changes: 37 additions & 0 deletions examples/beerpub-yoga/src/models.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
export type URL = unknown;

export enum BeerGenre {
IPA = 'IPA',
LAGER = 'LAGER',
PORTER = 'PORTER',
}

export interface CreateBeer {
name: string;
price: number;
url?: URL | undefined;
genre?: BeerGenre | undefined;
}
export interface UpdateBeer {
name?: string | undefined;
Expand Down Expand Up @@ -31,11 +38,31 @@ export type Models = {
url: {
args: Record<string, never>;
};
genre: {
args: Record<string, never>;
};
};
['Chips']: {
_id: {
args: Record<string, never>;
};
createdAt: {
args: Record<string, never>;
};
name: {
args: Record<string, never>;
};
price: {
args: Record<string, never>;
};
};
['Query']: {
beers: {
args: Record<string, never>;
};
products: {
args: Record<string, never>;
};
testAuth: {
args: Record<string, never>;
};
Expand Down Expand Up @@ -71,6 +98,8 @@ export interface Node {
createdAt: string;
}

export type Product = Beer | Chips;

export type Scalars = {
['URL']: unknown;
};
Expand All @@ -82,9 +111,17 @@ export interface Beer {
createdAt: string;
info?: string | undefined;
url?: URL | undefined;
genre?: BeerGenre | undefined;
}
export interface Chips {
_id: string;
createdAt: string;
name: string;
price: number;
}
export interface Query {
beers?: Array<Beer> | undefined;
products?: Array<Product> | undefined;
testAuth: string;
}
export interface Mutation {
Expand Down
4 changes: 2 additions & 2 deletions modularium/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aexol/modularium",
"version": "0.5.0",
"version": "0.5.1",
"private": false,
"main": "./lib/index.js",
"author": "Aexol, Artur Czemiel",
Expand All @@ -17,7 +17,7 @@
"lib"
],
"dependencies": {
"@aexol/axolotl-config": "^0.5.0",
"@aexol/axolotl-config": "^0.5.1",
"chalk": "^5.3.0",
"commander": "^11.0.0"
}
Expand Down
4 changes: 2 additions & 2 deletions modularium/playground/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aexol/modularium-playground",
"version": "0.5.0",
"version": "0.5.1",
"description": "Axolotl modularium",
"main": "lib/index.js",
"type": "module",
Expand All @@ -14,6 +14,6 @@
"author": "GraphQL Editor Centaur Generator",
"license": "ISC",
"devDependencies": {
"@aexol/modularium": "^0.5.0"
"@aexol/modularium": "^0.5.1"
}
}
8 changes: 4 additions & 4 deletions modularium/root/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aexol/modularium-root",
"version": "0.5.0",
"version": "0.5.1",
"description": "Axolotl modularium",
"main": "lib/index.js",
"type": "module",
Expand All @@ -20,8 +20,8 @@
"author": "GraphQL Editor Centaur Generator",
"license": "ISC",
"dependencies": {
"@aexol/axolotl-core": "^0.5.0",
"@aexol/axolotl-graphql-yoga": "^0.5.0",
"@aexol/axolotl-core": "^0.5.1",
"@aexol/axolotl-graphql-yoga": "^0.5.1",
"googleapis": "^140.0.1",
"graphql": "^16.8.1",
"graphql-yoga": "^4.0.5",
Expand All @@ -32,7 +32,7 @@
"ws": "^8.12.0"
},
"devDependencies": {
"@aexol/axolotl": "^0.5.0",
"@aexol/axolotl": "^0.5.1",
"@types/jsonwebtoken": "^9.0.6",
"@types/node": "^18.7.18",
"@typescript-eslint/eslint-plugin": "^7.12.0",
Expand Down
Loading

0 comments on commit 125fa9d

Please sign in to comment.