У меня есть метод, который получает данные из запроса GraphQl. Я пытаюсь передать токен переменных и passID в запрос graphQL.
saveData ( auditid: any ) {
this.storage.get('AccessToken').then((_token) => {
var passID = auditid.toString();
var token = _token;
this.apollo.watchQuery(
{
query: gql`
{
gechecklist( id:$passID, accesstoken:$token )
{
Type,Name,
Sections
}
,ID
}
}
`,
fetchPolicy: 'cache-first',
})
.valueChanges.subscribe(( result: ApolloQueryResult<any> ) => {
let sections = result.data.gechecklist[0].Sections;
this.storage.set( name, JSON.stringify( sections )).then(() => {
this.listKeys();
});
});
});
}