Provide helpers (react hooks, utily function, ...) to manipulate jahia datas
yarn add @jahia/data-helper
@jahia/data-helper include graphql fragment to reduce the size of the graphql queries and help you with mandatory field to update apollo cache.
You can use it like this:
import gql from 'graphql-tag';
import {PredefinedFragments} from '@jahia/data-helper';
export const ContentPickerFilledQuery = gql`
query contentPickerFilledQuery($uuid: String!, $language: String!, $needToFetch: Boolean!) {
jcr @include(if: $needToFetch) {
result: nodeById(uuid: $uuid) {
displayName(language: $language)
primaryNodeType {
displayName(language: $language)
icon
}
...NodeCacheRequiredFields
}
}
}
${PredefinedFragments.nodeCacheRequiredFields.gql}
`;
👤 Jahia
- Website: https://www.jahia.com
- Twitter: @Jahia
- Github: @Jahia
- LinkedIn: @Jahia
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2020 Jahia.
This project is SEE LICENSE IN ../../LICENSE.txt FILE licensed.
This README was generated with ❤️ by readme-md-generator