
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
@homebound/graphql-typescript-resolver-scaffolding
Advanced tools
This is a graphql-code-generator plugin that generates scaffolding for resolvers.
The generated scaffolds are extremely simple, and really just placeholders for your business logic and tests.
I.e. given ./schema/schema.graphql:
type Mutations {
createFoo(input: FooInput): FooResult
}
These two files will be generated:
src/resolvers/mutations/createFoo.tssrc/resolvers/mutations/createFoo.test.tsWith some minimal boilerplate included.
If you break up your mutations into multiple files, i.e. ./schema/foo.graphql :
extend type Mutations {
createFoo(input: FooInput): FooResult
}
Then the two files will be located at:
src/resolvers/mutations/foo/createFoo.tssrc/resolvers/mutations/foo/createFoo.test.tsThe generator works on a "create file if not already in place" approach, which means you can't really "turn off" certain files that the generator thinks you need, you need to have your existing resolver files already in the place it expects, and then it won't overwrite them.
The placement logic is:
schema.graphql and root.graphql
src/resolvers/queries/<field-name>.tssrc/resolvers/mutations/<field-name>.tssrc/resolvers/objects/<type-name>.tsqueries.graphql, mutations.graphql, and subscriptions.graphql<fileName>.graphql
extend type Querys go in src/resolvers/queries/<file-name>/<field-name.ts>extend type Mutations go in src/resolvers/mutations/<file-name>/<field-name.ts>src/resolvers/objects/<file-name>/<type-name>.tsI.e. each query and mutation gets its own dedicated <field-name.ts> file, potentially in a sub-directory based on the file name it's declared in.
Field resolvers for a given object go in a <type-name.ts>, potentially in a sub-directory based on the file the object is declared in.
Todo: Think about where extend type OtherObject things go, when both in schema.graphql (seems uncommon) or fileName.graphql. ...in the same sub-directory as fileName?
The plugin only generates scaffolds for objects that are mapped types.
scaffolding.ignoreObjectsPattern will ignore certain objects that are mapped types, but you don't want scaffoldedContext and in src/context@src/... import alias setupsrc/mutations/testUtils module with a run methodFooInput/FooResult pattern for mutations./schema/*.graphql filesFAQs
Unknown package
The npm package @homebound/graphql-typescript-resolver-scaffolding receives a total of 244 weekly downloads. As such, @homebound/graphql-typescript-resolver-scaffolding popularity was classified as not popular.
We found that @homebound/graphql-typescript-resolver-scaffolding demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 23 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.