Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type for nexus graphql #221

Open
wants to merge 1 commit into
base: latest
Choose a base branch
from
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
Binary file modified packages/cms/database/development.sqlite
Binary file not shown.
1 change: 1 addition & 0 deletions packages/cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@strapi/strapi": "^4.11.4",
"@strapi/typescript-utils": "^4.11.4",
"better-sqlite3": "^8.4.0",
"nexus": "^1.3.0",
"pg": "^8.11.1",
"strapi-blurhash": "^1.1.1",
"strapi-plugin-react-icons": "^0.1.6"
Expand Down
6 changes: 3 additions & 3 deletions packages/cms/src/graphql/extensions/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { core } from "nexus"
import resolvers, { resolversConfig } from "../resolvers"

const readOnlyEntities = [
"plugin::users-permissions.permission",
"plugin::users-permissions.role",
Expand All @@ -9,7 +9,7 @@ const readOnlyEntities = [

const writeOnlyEntities = ["plugin::upload.folder"]

const schemaExtension: Graphql.ExtensionCallback = ({ nexus }) => ({
const schemaExtension: Graphql.ExtensionCallback = ({ nexus }: { nexus: typeof core }) => ({
types: [
nexus.extendType({
type: "Query",
Expand All @@ -19,7 +19,7 @@ const schemaExtension: Graphql.ExtensionCallback = ({ nexus }) => ({
})
},
}),
nexus.extendType<"UsersPermissionsUser">({
nexus.extendType({
type: "UsersPermissionsUser",
definition: t => {
t.nonNull.id("id")
Expand Down
2 changes: 1 addition & 1 deletion packages/cms/src/types/generated/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export interface UiText extends Schema.Component {
}

declare module "@strapi/strapi" {
export namespace Shared {
export module Shared {
export interface Components {
"data.entry": DataEntry
"data.set": DataSet
Expand Down
2 changes: 1 addition & 1 deletion packages/cms/src/types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ export interface PluginReactIconsIconlibrary extends Schema.CollectionType {
}

declare module "@strapi/strapi" {
export namespace Shared {
export module Shared {
export interface ContentTypes {
"admin::permission": AdminPermission
"admin::user": AdminUser
Expand Down
Loading