Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17,201 changes: 6,759 additions & 10,442 deletions package-lock.json

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "adminjs-graphql",
"version": "3.0.0",
"type": "module",
"description": "adminjs GraphQL adapter",
"keywords": [
"admin-bro",
Expand All @@ -26,24 +27,24 @@
"author": "Erik Agsjö",
"license": "ISC",
"devDependencies": {
"@types/jest": "^27.5.2",
"@types/node": "^16.6.1",
"@typescript-eslint/eslint-plugin": "^4.29.2",
"@typescript-eslint/parser": "^4.29.2",
"adminjs": "^6.1.2",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"jest": "^27.2.5",
"ts-jest": "^27.0.5",
"ts-node": "^10.2.0",
"ts-node-dev": "1.1",
"typescript": "^4.7.4"
"@types/jest": "^29.5.8",
"@types/node": "^18.18.2",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"adminjs": "^7.3.0",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"jest": "^29.7.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"ts-node-dev": "2.0.0",
"typescript": "^5.2.2"
},
"peerDependencies": {
"adminjs": "^6.1.1"
"adminjs": "^7.3.0"
},
"dependencies": {
"axios": "^0.21.1",
"graphql": "^14.7.0"
"axios": "^1.6.1",
"graphql": "^16.8.1"
}
}
4 changes: 2 additions & 2 deletions src/GraphQLAdapter.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { BaseDatabase, BaseResource } from "adminjs";
import { GraphQLConnection } from ".";
import { GraphQLConnection } from "./index.js";
import {
GraphQLResourceAdapter,
InternalGraphQLResource,
} from "./GraphQLResource";
} from "./GraphQLResource.js";

class GraphQLDatabaseAdapter extends BaseDatabase {
public constructor(public readonly connection: GraphQLConnection) {
Expand Down
7 changes: 4 additions & 3 deletions src/GraphQLConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import {
GraphQLNonNull,
} from "graphql";

import { GraphQLClient } from "./GraphQLClient";
import { GraphQLPropertyAdapter } from "./GraphQLProperty";
import { InternalGraphQLResource, GraphQLResource } from "./GraphQLResource";
import { GraphQLClient } from "./GraphQLClient.js";
import { GraphQLPropertyAdapter } from "./GraphQLProperty.js";
import { InternalGraphQLResource, GraphQLResource } from "./GraphQLResource.js";

/**
* Options for the GraphQL connection.
Expand Down Expand Up @@ -358,6 +358,7 @@ export class GraphQLConnection {
} catch (thrown) {
let error = thrown as Error;
const axiosError = error as AxiosError;
// @ts-ignore
const graphQLErrors = axiosError.response?.data?.errors;
if (graphQLErrors) {
error = new Error(this.formatGraphQLErrors(graphQLErrors));
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQLResource.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GraphQLFloat, GraphQLString } from "graphql";
import { _testing } from "../src/GraphQLResource";
import { _testing } from "./GraphQLResource.js";
const { deflateParams, inflateParams } = _testing;

describe("Resource parameter deflation", () => {
Expand Down
4 changes: 2 additions & 2 deletions src/GraphQLResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
PropertyErrors,
} from "adminjs";

import { GraphQLConnection } from ".";
import { GraphQLPropertyAdapter } from "./GraphQLProperty";
import { GraphQLConnection } from "./index.js";
import { GraphQLPropertyAdapter } from "./GraphQLProperty.js";

/**
* The actual GraphQL query/mutation that will be called to
Expand Down
5 changes: 3 additions & 2 deletions src/builder/builder.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { DocumentNode } from "graphql";
import { GraphQLResource, FieldFilter, GraphQLConnection } from "..";
import { GraphQLResource, FieldFilter, GraphQLConnection } from "../index.js";
import {
ResourceWithOptions,
ResourceOptions,
LocaleTranslations,
LocaleTranslationsBlock,
FeatureType,
} from "adminjs";
import { FindOptions } from "../GraphQLResource";
import { FindOptions } from "../GraphQLResource.js";

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type Entity = Record<string, any>;
Expand Down Expand Up @@ -365,6 +365,7 @@ export function configureResource(
return {
resource,
configuration,
// @ts-ignore
translations,
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/builder/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "./builder";
export * from "./builder.js";
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from "./GraphQLAdapter";
export * from "./GraphQLConnection";
export * from "./GraphQLResource";
export * from "./GraphQLProperty";
export * from "./builder";
export * from "./GraphQLAdapter.js";
export * from "./GraphQLConnection.js";
export * from "./GraphQLResource.js";
export * from "./GraphQLProperty.js";
export * from "./builder/index.js";
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
"incremental": false, /* Enable incremental compilation */
"target": "ES2019", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"target": "ESNext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "NodeNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"lib": [
"ES2020"
], /* Specify library files to be included in the compilation. */
Expand Down