
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
@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.ts
src/resolvers/mutations/createFoo.test.ts
With 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.ts
src/resolvers/mutations/foo/createFoo.test.ts
The 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>.ts
src/resolvers/mutations/<field-name>.ts
src/resolvers/objects/<type-name>.ts
queries.graphql
, mutations.graphql
, and subscriptions.graphql
<fileName>.graphql
extend type Query
s go in src/resolvers/queries/<file-name>/<field-name.ts>
extend type Mutation
s go in src/resolvers/mutations/<file-name>/<field-name.ts>
src/resolvers/objects/<file-name>/<type-name>.ts
I.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 75 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 24 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.