import apollo from "../../../lib/apollo"; async function companies(input){ var res = await apollo.query( ` query($input: String!){ companies{ data{ attributes{ Business_name Name Description Icon { data { attributes{ url } } } Background{ data{ attributes{ url } } } Website } } } main_banner:companies(filters:{Name:{eq:$input}}){ data{ attributes{ Contents(filters :{Type:{eq:"Main_Banner"}}){ data{ attributes{ Title Description Image{ data{ attributes{ url } } } } } } } } } news:companies(filters:{Name:{eq:$input}}){ data{ id attributes{ Contents(filters:{Type:{eq:"News"}}){ data{ id attributes{ Title Description Image{ data{ attributes{ url } } } } } } } } } gallery:companies(filters:{Name:{eq:$input}}){ data{ attributes{ Gallery{ data{ attributes{ url } } } } } } }`,"",{ "input":input } ); return res; } // async function getID(partner, token = "") { // var res = await apollo.query( // ` // query($input : String!){ // businessPartners(where:{name_contains:$input}){ // id // } // }`, // token, // { // input: partner, // } // ); // return res; // } // async function getData(partner,token=''){ // var res = await apollo.query( // ` // query($input : String!){ // businessPartners(where:{name_contains:$input}){ // id, // name, // icon{ // url // }, // background{ // url // }, // carousel{ // url // } // } // } // ` // ); // } module.exports = { // getID: getID, // getData:getData, companies:companies, };