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:
prathamesh0
2024-02-01 11:37:57 +05:30
committed by Ashwin Phatak
co-authored by neeraj
parent 1f192444c4
commit 9f1306f9cd
9 changed files with 159 additions and 13 deletions
+9 -1
View File
@@ -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;
}
}
+31
View File
@@ -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
}
}
}
`;