Conversion of schemas from v2 json to v3 typescript is not clear #3952
-
When looking at the documentation for adding schemas, it mentions an 'index.js' file for importing (this apparently changed from the schema.js file). However on a new V3 clean install to a different server/directory, there is an index.ts file instead. I was looking at https://www.sanity.io/docs/migrating-schema-types but it hasn't helped. I made a 'conversion' of a schema to test with, but it does not show up in sanity studio. Sanity studio just says 'no document types' So I have a few questions..
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If it helps anyone else, since no help was forthcoming on this, for their 'book' example, index.ts would need to read:
|
Beta Was this translation helpful? Give feedback.
-
i have same isssue too. and the documentation is not clear on what to do |
Beta Was this translation helpful? Give feedback.
If it helps anyone else, since no help was forthcoming on this,
for their 'book' example, index.ts would need to read:
import { book} from "./book.ts" export const schemaTypes = [book]