Skip to content

Commit 00b51d3

Browse files
author
Alfred Brockotter
committed
docs: Added type resolver documentation
This closes #2
1 parent 1ea6577 commit 00b51d3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,32 @@ export default function ({ store, $deliveryClient }) {
8888
return headers;
8989
}
9090
}
91+
```
92+
93+
### Type Resolvers
94+
95+
Type resolvers can also be registered by using a nuxt plugin:
96+
97+
### plugins/kenticokontentNuxtModule.js
98+
```
99+
import { TypeResolver, ContentItem } from '@kentico/kontent-delivery';
100+
101+
class Page extends ContentItem {
102+
constructor() {
103+
super({
104+
richTextResolver: (item, context) => {
105+
// todo: implement
106+
},
107+
urlSlugResolver: (link, context) => {
108+
// todo: implement
109+
}
110+
});
111+
}
112+
}
113+
114+
export default function ({ store, app, $deliveryClient }) {
115+
$deliveryClient.config.typeResolvers = [
116+
new TypeResolver('page', () => new Page())
117+
]
118+
}
91119
```

0 commit comments

Comments
 (0)