Show public repo GitHub activity without authentication (#68)

* Handle request error while fetching Git activity

* Use default Octokit instance if auth token is not available

* Rename input arguments of mutation methods to data

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
This commit is contained in:
2024-02-14 17:35:02 +05:30
committed by GitHub
co-authored by neeraj
parent db3b9148b6
commit 9921dc5186
10 changed files with 103 additions and 90 deletions
+12 -12
View File
@@ -206,28 +206,28 @@ export class GQLClient {
return result.data;
}
async updateProject (projectId: string, projectDetails: types.UpdateProjectInput): Promise<types.UpdateProjectResponse> {
const { data } = await this.client.mutate({
async updateProject (projectId: string, data: types.UpdateProjectInput): Promise<types.UpdateProjectResponse> {
const result = await this.client.mutate({
mutation: mutations.updateProjectMutation,
variables: {
projectId,
projectDetails
data
}
});
return data;
return result.data;
}
async updateDomain (domainId: string, domainDetails: types.UpdateDomainInput): Promise<types.UpdateDomainResponse> {
const { data } = await this.client.mutate({
async updateDomain (domainId: string, data: types.UpdateDomainInput): Promise<types.UpdateDomainResponse> {
const result = await this.client.mutate({
mutation: mutations.updateDomainMutation,
variables: {
domainId,
domainDetails
data
}
});
return data;
return result.data;
}
async redeployToProd (deploymentId: string): Promise<types.RedeployToProdResponse> {
@@ -275,16 +275,16 @@ export class GQLClient {
return data;
}
async addDomain (projectId: string, domainDetails: types.AddDomainInput): Promise<types.AddDomainResponse> {
const { data } = await this.client.mutate({
async addDomain (projectId: string, data: types.AddDomainInput): Promise<types.AddDomainResponse> {
const result = await this.client.mutate({
mutation: mutations.addDomain,
variables: {
projectId,
domainDetails
data
}
});
return data;
return result.data;
}
async getDomains (projectId: string, filter?: types.FilterDomainInput): Promise<types.GetDomainsResponse> {
+6 -6
View File
@@ -50,13 +50,13 @@ mutation ($organizationSlug: String!, $data: AddProjectInput) {
}`;
export const updateProjectMutation = gql`
mutation ($projectId: String!, $projectDetails: UpdateProjectInput) {
updateProject(projectId: $projectId, projectDetails: $projectDetails)
mutation ($projectId: String!, $data: UpdateProjectInput) {
updateProject(projectId: $projectId, data: $data)
}`;
export const updateDomainMutation = gql`
mutation ($domainId: String!, $domainDetails: UpdateDomainInput!) {
updateDomain(domainId: $domainId, domainDetails: $domainDetails)
mutation ($domainId: String!, $data: UpdateDomainInput!) {
updateDomain(domainId: $domainId, data: $data)
}`;
export const redeployToProd = gql`
@@ -83,8 +83,8 @@ mutation ($projectId: String! ,$deploymentId: String!) {
`;
export const addDomain = gql`
mutation ($projectId: String!, $domainDetails: AddDomainInput!) {
addDomain(projectId: $projectId, domainDetails: $domainDetails)
mutation ($projectId: String!, $data: AddDomainInput!) {
addDomain(projectId: $projectId, data: $data)
}
`;