NOTE: whenever defining a new type here, please also add it in x/keys.go: preDefinedTypeMap
(namespace uint64, all bool)
| 652 | |
| 653 | // NOTE: whenever defining a new type here, please also add it in x/keys.go: preDefinedTypeMap |
| 654 | func initialTypesInternal(namespace uint64, all bool) []*pb.TypeUpdate { |
| 655 | var initialTypes []*pb.TypeUpdate |
| 656 | initialTypes = append(initialTypes, |
| 657 | &pb.TypeUpdate{ |
| 658 | TypeName: "dgraph.graphql", |
| 659 | Fields: []*pb.SchemaUpdate{ |
| 660 | { |
| 661 | Predicate: "dgraph.graphql.schema", |
| 662 | ValueType: pb.Posting_STRING, |
| 663 | }, |
| 664 | { |
| 665 | Predicate: "dgraph.graphql.xid", |
| 666 | ValueType: pb.Posting_STRING, |
| 667 | }, |
| 668 | }, |
| 669 | }, |
| 670 | &pb.TypeUpdate{ |
| 671 | TypeName: "dgraph.graphql.persisted_query", |
| 672 | Fields: []*pb.SchemaUpdate{ |
| 673 | { |
| 674 | Predicate: "dgraph.graphql.p_query", |
| 675 | ValueType: pb.Posting_STRING, |
| 676 | }, |
| 677 | }, |
| 678 | }) |
| 679 | |
| 680 | if namespace == x.RootNamespace { |
| 681 | initialTypes = append(initialTypes, |
| 682 | &pb.TypeUpdate{ |
| 683 | TypeName: "dgraph.namespace", |
| 684 | Fields: []*pb.SchemaUpdate{ |
| 685 | { |
| 686 | Predicate: "dgraph.namespace.name", |
| 687 | ValueType: pb.Posting_STRING, |
| 688 | }, |
| 689 | { |
| 690 | Predicate: "dgraph.namespace.id", |
| 691 | ValueType: pb.Posting_INT, |
| 692 | }, |
| 693 | }, |
| 694 | }) |
| 695 | } |
| 696 | |
| 697 | if all || x.WorkerConfig.AclEnabled { |
| 698 | // These type definitions are required for deleteUser and deleteGroup GraphQL API to work |
| 699 | // properly. |
| 700 | initialTypes = append(initialTypes, |
| 701 | &pb.TypeUpdate{ |
| 702 | TypeName: "dgraph.type.User", |
| 703 | Fields: []*pb.SchemaUpdate{ |
| 704 | { |
| 705 | Predicate: "dgraph.xid", |
| 706 | ValueType: pb.Posting_STRING, |
| 707 | }, |
| 708 | { |
| 709 | Predicate: "dgraph.password", |
| 710 | ValueType: pb.Posting_PASSWORD, |
| 711 | }, |
no test coverage detected