|
1 | | -# This sample schema shows how to use the functions defined in this plugin. |
2 | | - |
3 | | -# this directive will eventually be built-in, and will replace @lambda |
4 | | -directive @hm_function(name: String, args: [String!]) on FIELD_DEFINITION |
5 | | - |
6 | | -type Query { |
7 | | - add(a: Int!, b: Int!): Int! @lambda @hm_function |
8 | | - getFullName(firstName: String!, lastName: String!): String! @lambda @hm_function |
9 | | - getPeople: [Person!]! @lambda @hm_function |
10 | | - queryPeople1: [Person!]! @lambda @hm_function |
11 | | - queryPeopleWithVars(firstName: String!, lastName: String!): [Person!]! @lambda @hm_function |
12 | | - queryPeople2: [Person!]! @lambda @hm_function |
13 | | - getRandomPerson: Person! @lambda @hm_function |
14 | | - testError: Int! @lambda @hm_function |
15 | | - testClassifier(modelId: String!, text: String!): ClassificationResult! @lambda @hm_function |
16 | | - testMultipleClassifier(modelId: String!, ids: String!, texts: String!): [ClassificationObject!]! @lambda @hm_function |
17 | | - testEmbedding(modelId: String!, text: String!): String! @lambda @hm_function |
18 | | - testEmbeddings(modelId: String!, ids: String!, texts: String!): [EmbeddingObject!]! @lambda @hm_function |
19 | | - testTextGenerator(modelId: String!, instruction: String!, text: String!): String! @lambda @hm_function |
20 | | -} |
21 | | - |
22 | | -type Mutation { |
23 | | - newPerson1(firstName: String!, lastName: String!): String! @lambda @hm_function |
24 | | - newPerson2(firstName: String!, lastName: String!): String! @lambda @hm_function |
25 | | -} |
| 1 | +# This sample schema is used for the examples that work with Dgraph. |
| 2 | +# It can be applied to Dgraph with some sample data using the |
| 3 | +# ./loaddata.sh script. |
26 | 4 |
|
27 | 5 | type Person { |
28 | 6 | id: ID! |
29 | 7 | firstName: String! @search(by: [hash]) |
30 | 8 | lastName: String! @search(by: [hash]) |
31 | | - fullName: String @lambda @hm_function(name: "getFullName", args: ["firstName", "lastName"]) |
32 | | -} |
33 | | - |
34 | | -type EmbeddingObject @remote { |
35 | | - id: String |
36 | | - text: String |
37 | | - embedding: String |
38 | | -} |
39 | | - |
40 | | -type ClassificationObject @remote { |
41 | | - id: String |
42 | | - text: String |
43 | | - result: ClassificationResult |
44 | | -} |
45 | | - |
46 | | -type ClassificationResult @remote { |
47 | | - probabilities: [ClassificationProbability] |
48 | | -} |
49 | | - |
50 | | -type ClassificationProbability @remote { |
51 | | - label: String |
52 | | - probability: Float |
53 | 9 | } |
0 commit comments