Comments (4)
Hello
SDK had a breaking change so this will require a new release. Stay tuned, I plan to work on it this weekend.
from prisma-docs-generator.
Sorry for the delay here. This is fixed in https://github.com/pantharshit00/prisma-docs-generator/releases/tag/v0.5.0 https://www.npmjs.com/package/prisma-docs-generator/v/0.5.0
from prisma-docs-generator.
Getting same issue even with 2.30.1
from prisma-docs-generator.
Looks like the shape of the data has changed from what this method getModelDirective is expecting.
It seems the idFields
property no longer exists and instead there is property on each field called isId
. Could probably update that method to iterate over the fields and do something like the below. Good PR opportunity for someone with more time than me.
for (let i = 0; i < model.fields.length; i+=1) {
const field = model.fields[i];
if (field.isId) {
directiveValue.push({ name: '@@id', values: [field] });
}
if (field.isUnique) {
directiveValue.push({
name: '@@unique',
values: [field],
});
}
}
example model object
{
name: 'User',
isEmbedded: false,
dbName: null,
fields: [
{
name: 'id',
kind: 'scalar',
isList: false,
isRequired: true,
isUnique: false,
isId: true,
isReadOnly: false,
type: 'Int',
hasDefaultValue: true,
default: [Object],
isGenerated: false,
isUpdatedAt: false
},
{
name: 'email',
kind: 'scalar',
isList: false,
isRequired: true,
isUnique: true,
isId: false,
isReadOnly: false,
type: 'String',
hasDefaultValue: false,
isGenerated: false,
isUpdatedAt: false
},
{
name: 'name',
kind: 'scalar',
isList: false,
isRequired: false,
isUnique: false,
isId: false,
isReadOnly: false,
type: 'String',
hasDefaultValue: false,
isGenerated: false,
isUpdatedAt: false
},
{
name: 'profile',
kind: 'object',
isList: false,
isRequired: false,
isUnique: false,
isId: false,
isReadOnly: false,
type: 'Profile',
hasDefaultValue: false,
relationName: 'ProfileToUser',
relationFromFields: [],
relationToFields: [],
relationOnDelete: 'SetNull',
isGenerated: false,
isUpdatedAt: false
}
],
isGenerated: false,
primaryKey: null,
uniqueFields: [],
uniqueIndexes: []
}
from prisma-docs-generator.
Related Issues (20)
- [FIXED] Do not define a valid '.' target HOT 4
- Unknown arg `is` and `isNot` HOT 1
- [feat] Summary of models at top HOT 2
- TypeError HOT 3
- Add enums to the docs HOT 2
- TypeError: mappings.filter is not a function HOT 3
- Cannot read property 'map' of undefined with Prisma v2.15 HOT 5
- Generating OpenAPI/Swagger Specs HOT 2
- hosting is not working [bug] HOT 5
- Generated HTML has styling issue HOT 1
- Can I use comments in `schema.prisma` HOT 1
- Can we please have 'full' examples that show how to create associations.
- Select property not included
- Must enable 'extendedIndexes` preview feature when trying to serve documents HOT 1
- Docs should specify to be a dev dependency HOT 1
- @default([]) will crash the generator HOT 2
- DARK MODE HOT 1
- Pagination and groupping + mermaid diagram HOT 1
- Hope not to generate operation contents
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisma-docs-generator.