Skip to content

Commit

Permalink
chore: update schema
Browse files Browse the repository at this point in the history
  • Loading branch information
rameshlohala committed May 21, 2024
1 parent c796fef commit 3985181
Show file tree
Hide file tree
Showing 8 changed files with 178 additions and 1,183 deletions.
2 changes: 1 addition & 1 deletion packages/mercurius/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"typecheck": "tsc --noEmit -p tsconfig.json --composite false"
},
"dependencies": {
"mercurius-codegen": "5.0.4",
"graphql-tag": "2.12.6",
"@graphql-tools/merge": "9.0.4"
},
"devDependencies": {
Expand Down
5 changes: 3 additions & 2 deletions packages/mercurius/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ declare module "@dzangolab/fastify-config" {
}

export { default } from "./plugin";
export { gql } from "mercurius-codegen";
export { gql } from "graphql-tag";
export { mergeTypeDefs } from "@graphql-tools/merge";
export { default as typeDefs } from "./typeDefs";
export { default as baseSchema } from "./schema";

export type { MercuriusEnabledPlugin } from "./types";
export type { DocumentNode } from "graphql";
31 changes: 31 additions & 0 deletions packages/mercurius/src/schema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { gql } from "graphql-tag";

const typeDefs = gql`
scalar DateTime
scalar JSON
input Filters {
AND: [Filters]
OR: [Filters]
not: Boolean
key: String
operator: String
value: String
}
enum SortDirection {
ASC
DESC
}
input SortInput {
key: String
direction: SortDirection
}
type DeleteResult {
result: Boolean!
}
`;

export default typeDefs;
28 changes: 0 additions & 28 deletions packages/mercurius/src/typeDefs.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
gql,
mergeTypeDefs,
typeDefs as BaseTypeDefs,
} from "@dzangolab/fastify-mercurius";
import { gql, mergeTypeDefs, baseSchema } from "@dzangolab/fastify-mercurius";

import invitationSchema from "../model/invitations/schema";
import roleSchema from "../model/roles/schema";
Expand All @@ -24,7 +20,7 @@ const schema = gql`
`;

const typeDefs = mergeTypeDefs([
BaseTypeDefs,
baseSchema,
schema,
invitationSchema,
roleSchema,
Expand Down
1 change: 1 addition & 0 deletions packages/user/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export { default as areRolesExist } from "./supertokens/utils/areRolesExist";
export { default as validateEmail } from "./validator/email";
export { default as validatePassword } from "./validator/password";
export { default as hasUserPermission } from "./lib/hasUserPermission";
export { default as userSchema } from "./graphql/schema";

export * from "./constants";

Expand Down
10 changes: 1 addition & 9 deletions packages/user/src/model/users/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,18 @@ const user = gql`
id: String!
disabled: Boolean!
email: String!
givenName: String
lastLoginAt: Float!
middleNames: String
roles: [String]
signedUpAt: Float!
surname: String
timeJoined: Float
}
input UserUpdateInput {
givenName: String
middleNames: String
surname: String
id: String
}
type UserProfile {
givenName: String
id: String
middleNames: String
surname: String
}
type Users {
Expand Down
Loading

0 comments on commit 3985181

Please sign in to comment.