-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from deepsquare-io/chore/release-v.1.1.0
Chore/release v.1.1.0
- Loading branch information
Showing
12 changed files
with
199 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2023 Deepsquare Association | ||
// This file is part of Foobar. | ||
// Foobar is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
// Foobar is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
// You should have received a copy of the GNU General Public License along with Foobar. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
export default interface Workflow { | ||
_id: string; | ||
content: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2023 Deepsquare Association | ||
// This file is part of Foobar. | ||
// Foobar is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
// Foobar is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
// You should have received a copy of the GNU General Public License along with Foobar. If not, see <https://www.gnu.org/licenses/>. | ||
import type { Model } from 'mongoose'; | ||
import { model, models, Schema } from 'mongoose'; | ||
import { v4 } from 'uuid'; | ||
import type Workflow from './Workflow'; | ||
|
||
export const WorkflowSchema = new Schema<Workflow>({ | ||
_id: { type: String, default: v4 }, | ||
content: { type: String, required: true }, | ||
}); | ||
|
||
const WorkflowModel: Model<Workflow> = models.Workflow ?? model('Workflow', WorkflowSchema, 'workflows'); | ||
|
||
export default WorkflowModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/graphql/internal/client/generated/getWorkflow.generated.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { gql } from '@apollo/client'; | ||
import * as Apollo from '@apollo/client'; | ||
import type * as Types from './Types'; | ||
|
||
const defaultOptions = {} as const; | ||
export type GetWorkflowQueryVariables = Types.Exact<{ | ||
workflowId: Types.Scalars['String']; | ||
}>; | ||
|
||
export type GetWorkflowQuery = { getWorkflow?: string | null }; | ||
|
||
export const GetWorkflowDocument = /*#__PURE__*/ gql` | ||
query GetWorkflow($workflowId: String!) { | ||
getWorkflow(workflowId: $workflowId) | ||
} | ||
`; | ||
|
||
/** | ||
* __useGetWorkflowQuery__ | ||
* | ||
* To run a query within a React component, call `useGetWorkflowQuery` and pass it any options that fit your needs. | ||
* When your component renders, `useGetWorkflowQuery` returns an object from Apollo Client that contains loading, error, and data properties | ||
* you can use to render your UI. | ||
* | ||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; | ||
* | ||
* @example | ||
* const { data, loading, error } = useGetWorkflowQuery({ | ||
* variables: { | ||
* workflowId: // value for 'workflowId' | ||
* }, | ||
* }); | ||
*/ | ||
export function useGetWorkflowQuery(baseOptions: Apollo.QueryHookOptions<GetWorkflowQuery, GetWorkflowQueryVariables>) { | ||
const options = { ...defaultOptions, ...baseOptions }; | ||
return Apollo.useQuery<GetWorkflowQuery, GetWorkflowQueryVariables>(GetWorkflowDocument, options); | ||
} | ||
export function useGetWorkflowLazyQuery( | ||
baseOptions?: Apollo.LazyQueryHookOptions<GetWorkflowQuery, GetWorkflowQueryVariables>, | ||
) { | ||
const options = { ...defaultOptions, ...baseOptions }; | ||
return Apollo.useLazyQuery<GetWorkflowQuery, GetWorkflowQueryVariables>(GetWorkflowDocument, options); | ||
} | ||
export type GetWorkflowQueryHookResult = ReturnType<typeof useGetWorkflowQuery>; | ||
export type GetWorkflowLazyQueryHookResult = ReturnType<typeof useGetWorkflowLazyQuery>; | ||
export type GetWorkflowQueryResult = Apollo.QueryResult<GetWorkflowQuery, GetWorkflowQueryVariables>; | ||
export function refetchGetWorkflowQuery(variables: GetWorkflowQueryVariables) { | ||
return { query: GetWorkflowDocument, variables: variables }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright 2023 Deepsquare Association | ||
# This file is part of Nexus. | ||
# Nexus is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
# Nexus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
# You should have received a copy of the GNU General Public License along with Nexus. If not, see <https://www.gnu.org/licenses/>. | ||
query GetWorkflow($workflowId: String!) { | ||
getWorkflow(workflowId: $workflowId) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2023 Deepsquare Association | ||
// This file is part of Foobar. | ||
// Foobar is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
// Foobar is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
// You should have received a copy of the GNU General Public License along with Foobar. If not, see <https://www.gnu.org/licenses/>. | ||
import { injectable } from 'tsyringe'; | ||
import { Arg, Query, Resolver } from 'type-graphql'; | ||
import WorkflowModel from '../../../database/Workflow/WorkflowModel'; | ||
|
||
@injectable() | ||
@Resolver() | ||
export default class GetWorkflowQuery { | ||
@Query(() => String, { nullable: true }) | ||
async getWorkflow(@Arg('workflowId', () => String) workflowId: string) { | ||
const workflow = await WorkflowModel.findById(workflowId).lean().exec(); | ||
if (!workflow) { | ||
return null; | ||
} else { | ||
return workflow.content; | ||
} | ||
} | ||
} |
c245510
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nexus – ./
nexus-deepsquare.vercel.app
app.deepsquare.run
nexus-git-main-deepsquare.vercel.app