Skip to content

Commit

Permalink
feat: version v0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocorradini committed Dec 17, 2022
1 parent db0e941 commit da6e85d
Show file tree
Hide file tree
Showing 9 changed files with 555 additions and 372 deletions.
4 changes: 2 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"parserOptions": {
"project": [
"tsconfig.json",
"tsconfig.test.json",
"tests/tsconfig.json",
"examples/tsconfig.json"
],
"ecmaVersion": "latest",
Expand All @@ -23,7 +23,7 @@
"alwaysTryTypes": true,
"project": [
"tsconfig.json",
"tsconfig.test.json",
"tests/tsconfig.json",
"examples/tsconfig.json"
]
}
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v0.5.0](https://github.com/carlocorradini/graphql-auth-directive/releases/tag/v0.4.1) - 2022-12-17

### Changed

- Minimum GraphQL version v16.6.0

## [v0.4.1](https://github.com/carlocorradini/graphql-auth-directive/releases/tag/v0.4.1) - 2022-10-18

### Fixed
Expand Down
16 changes: 8 additions & 8 deletions examples/typegraphql/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
*/

import 'reflect-metadata';
import { makeExecutableSchema } from '@graphql-tools/schema';
import { buildTypeDefsAndResolversSync, registerEnumType } from 'type-graphql';
import { mergeSchemas } from '@graphql-tools/schema';
import { buildSchemaSync, registerEnumType } from 'type-graphql';
import { buildAuthDirective, defaultAuthFn } from '../../src';
import { Context, UserRoles, UserPermissions, main } from '../__commons';
import { UserResolver } from './UserResolver';
Expand All @@ -43,16 +43,16 @@ registerEnumType(UserRoles, { name: 'UserRoles' });
// Register UserPermissions enum
registerEnumType(UserPermissions, { name: 'UserPermissions' });

// Build schema
const { typeDefs, resolvers } = buildTypeDefsAndResolversSync({
// Build Schema
const schemaSimple = buildSchemaSync({
resolvers: [UserResolver, PostResolver],
validate: { forbidUnknownValues: false }
});
const executableSchema = makeExecutableSchema({
typeDefs: [authDirective.typeDefs, typeDefs],
resolvers
const schemaMerged = mergeSchemas({
schemas: [schemaSimple],
typeDefs: [authDirective.typeDefs]
});
const schema = authDirective.transformer(executableSchema);
const schema = authDirective.transformer(schemaMerged);

// Main
main(schema);
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ export default <JestConfigWithTsJest>{
collectCoverageFrom: ['<rootDir>/src/**/*.ts', '!<rootDir>/src/**/*.d.ts'],
moduleNameMapper: pathsToModuleNameMapper(tsconfig.compilerOptions.paths),
transform: {
'^.+\\.tsx?$': ['ts-jest', { tsconfig: './tsconfig.test.json' }]
'^.+\\.tsx?$': ['ts-jest', { tsconfig: './tests/tsconfig.json' }]
}
};
Loading

0 comments on commit da6e85d

Please sign in to comment.