forked from cerc-io/snowballtools-base
Integrate gql-client in frontend (#21)
* Integrate gql-client in frontend app * Populate home page information using gql-client * Remove non required fields from organizations query --------- Co-authored-by: neeraj <neeraj.rtly@gmail.com>
This commit is contained in:
committed by
Ashwin Phatak
co-authored by
neeraj
parent
1f192444c4
commit
9f1306f9cd
@@ -1,6 +1,6 @@
|
||||
import { ApolloClient, InMemoryCache, NormalizedCacheObject } from '@apollo/client';
|
||||
|
||||
import { getUser } from './gql-queries';
|
||||
import { getUser, getOrganizations } from './gql-queries';
|
||||
|
||||
export interface GraphQLConfig {
|
||||
gqlEndpoint: string;
|
||||
@@ -23,4 +23,12 @@ export class GQLClient {
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
async getOrganizations () : Promise<any> {
|
||||
const { data } = await this.client.query({
|
||||
query: getOrganizations
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,3 +11,34 @@ query {
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const getOrganizations = gql`
|
||||
query {
|
||||
organizations {
|
||||
projects {
|
||||
id
|
||||
owner {
|
||||
id
|
||||
}
|
||||
deployments {
|
||||
id
|
||||
}
|
||||
name
|
||||
repository
|
||||
prodBranch
|
||||
description
|
||||
template
|
||||
framework
|
||||
webhooks
|
||||
members {
|
||||
id
|
||||
}
|
||||
environmentVariables {
|
||||
id
|
||||
}
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user