Granular Per Model
{
"mode": "custom",
"strictCreateInputs": false,
"models": {
"User": {
"operations": ["findMany", "create"],
"variants": { "input": { "excludeFields": ["role"] } }
},
"Post": {
"operations": ["findMany", "findUnique"],
"variants": { "result": { "excludeFields": ["internalFlag"] } }
}
}
}
Enables partial surface per model: each model gets only the operations it lists, and the per-model variants.*.excludeFields entries narrow that model's field surface.
strictCreateInputs defaults to true, which makes *CreateInput, *UncheckedCreateInput and *CreateMany* schemas ignore field exclusions so they stay assignable to Prisma's own types. With the default, role would still appear in UserCreateInputObjectSchema even though it is excluded above — hence the explicit "strictCreateInputs": false.
If role is a required scalar without a default, also set "preserveRequiredScalarsOnCreate": false; otherwise required scalars are re-added to create inputs after the exclusion runs. WhereUniqueInput schemas always keep their unique selector fields regardless of either flag.
excludeFields list landsvariants.input.excludeFieldsfiltersvariants/input/<Model>.input.tsand theobjects/Where*/Create*/Update*input schemas.variants.result.excludeFieldsfiltersvariants/result/<Model>.result.ts(and the field lists used for Select/Include schemas). Per-operation schemas underresults/apply no field exclusions at all, sointernalFlagis still present inPostFindManyResult.schema.ts.variants.pure.excludeFieldsfiltersschemas/models/<Model>.schema.tsandvariants/pure/.
Model-level excludeFields lists support the same wildcard patterns as globalExclusions.input on the objects/ path; the pure-model and variant-file paths match exact field names only.