Comments (7)
Hi Travis, we actually have added a method to the SDK to do this and are preparing to publish it to GitHub. Here are two examples of usage:
`Examples
// get the id,name,type of all the items in the publishing channel
contentClient.graphql({
'query': '{ getItems(channelToken: "2834f431f8524ffa89dfb7fe77993284")
{ items { id name type } } }'
}).then(function (response) {
console.log(response);
});
// get the item slug with the corresponding id in a channel
contentClient.graphql({
'query': '{ getItem(id:"CORE51A353B7C6AA4EB29C74781FB418C93B",
channelToken:"546c6bdfe022455db92741407cccded3")
{ slug } }'
}).then(function (response) {
console.log(response);
});
`
do you think this will satisfy the requirements that you have?
from content-management-sdk.
Does your method support variables?
from content-management-sdk.
Yes, it does support variables - I spent some time today adding tests to validate variable usage. Usage in my test looks like:
const response = await sut.graphql({
query: 'query ($itemId: ID, $channelToken: String) {getItem(id: $itemId, channelToken: $channelToken) {id}}',
variables: {
itemId: process.env.VALID_DIGITAL_ASSET_ID_BASIC,
channelToken: process.env.CHANNEL_TOKEN_BASIC,
},
});
I have a few other tests to fix up and then I'll publish this to GitHub soon
from content-management-sdk.
Looks good to me. Once it's on GitHub, how long do you think OCM adoption will take?
from content-management-sdk.
The package has been published to npmjs now - are you consuming this SDK directly via your OCM service (e.g. for content layouts)?
from content-management-sdk.
from content-management-sdk.
We're working to unify the code that is published on the server with the github/npmjs codebase. The server code is much older though I think it does have a graphql method already which you can probably use.
from content-management-sdk.
Related Issues (6)
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 content-management-sdk.