Skip to content

Commit

Permalink
feat: add graphql for knowledgebase application
Browse files Browse the repository at this point in the history
Signed-off-by: Abirdcfly <[email protected]>
  • Loading branch information
Abirdcfly committed Dec 4, 2023
1 parent 8609db2 commit dfd75a6
Show file tree
Hide file tree
Showing 30 changed files with 2,960 additions and 712 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ gql-sdk-generator:
.PHONY: prepare-push
config_rule_line_num = $(shell grep -n "rules:" config/rbac/role.yaml | cut -d: -f1)
chart_rule_line_num = $(shell grep -n "rules:" deploy/charts/arcadia/templates/rbac.yaml | cut -d: -f1)
prepare-push: manifests generate fmt vet
prepare-push: manifests generate fmt vet gql-gen
@go mod tidy
@echo "install golangci-lint"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
Expand Down
8 changes: 6 additions & 2 deletions api/base/v1alpha1/application_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ type NodeConfig struct {
// ApplicationSpec defines the desired state of Application
type ApplicationSpec struct {
CommonSpec `json:",inline"`
// 开场白,只给客户看的内容,引导客户首次输入
// Icon base64 image icon
Icon string `json:"icon,omitempty"`
// IsPublic Set whether the current application provides services to the public
IsPublic bool `json:"isPublic,omitempty"`
// prologue, show in the chat top
Prologue string `json:"prologue,omitempty"`
// 节点
// Nodes
// +kubebuilder:validation:Required
Nodes []Node `json:"nodes"`
}
Expand Down
11 changes: 9 additions & 2 deletions config/crd/bases/arcadia.kubeagi.k8s.com.cn_applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,15 @@ spec:
displayName:
description: DisplayName defines datasource display name
type: string
icon:
description: Icon base64 image icon
type: string
isPublic:
description: IsPublic Set whether the current application provides
services to the public
type: boolean
nodes:
description: 节点
description: Nodes
items:
properties:
description:
Expand Down Expand Up @@ -83,7 +90,7 @@ spec:
type: object
type: array
prologue:
description: 开场白,只给客户看的内容,引导客户首次输入
description: prologue, show in the chat top
type: string
required:
- nodes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,15 @@ spec:
displayName:
description: DisplayName defines datasource display name
type: string
icon:
description: Icon base64 image icon
type: string
isPublic:
description: IsPublic Set whether the current application provides
services to the public
type: boolean
nodes:
description: 节点
description: Nodes
items:
properties:
description:
Expand Down Expand Up @@ -83,7 +90,7 @@ spec:
type: object
type: array
prologue:
description: 开场白,只给客户看的内容,引导客户首次输入
description: prologue, show in the chat top
type: string
required:
- nodes
Expand Down
6 changes: 3 additions & 3 deletions graphql-server/go-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Now that there is a `datasource` definition in the code, we can add new structur

### Add schema

go to `graph` dir.
go to `graph/schema` dir.

```shell
cat << EOF > x.graphqls
Expand All @@ -24,7 +24,7 @@ EOF

### Add a query function

The `graph/datasource.graphqls` file defines the Query structure, so we need to edit this file to add a function.
The `graph/schema/datasource.graphqls` file defines the Query structure, so we need to edit this file to add a function.

```shell
type Query {
Expand Down Expand Up @@ -91,7 +91,7 @@ Usage of ./bin/graphql-server:
3. Run graphql-server
> If you don't want to try playground,do not pass flag `-enable-plaground`
> If you don't want to try playground, do not pass flag `-enable-plaground`
```shell
./bin/graphql-server -enable-playground --client-id=bff-client --client-secret=some-secret --master-url=https://k8s-adress --issuer-url=https://oidc-server
Expand Down
Loading

0 comments on commit dfd75a6

Please sign in to comment.