(s string)
| 445 | } |
| 446 | |
| 447 | func parseGqlSchema(s string) map[uint64]string { |
| 448 | var schemas []x.ExportedGQLSchema |
| 449 | if err := json.Unmarshal([]byte(s), &schemas); err != nil { |
| 450 | fmt.Println("Error while decoding the graphql schema. Assuming it to be in format < 21.03.") |
| 451 | return map[uint64]string{x.RootNamespace: s} |
| 452 | } |
| 453 | |
| 454 | schemaMap := make(map[uint64]string) |
| 455 | for _, schema := range schemas { |
| 456 | if _, ok := schemaMap[schema.Namespace]; ok { |
| 457 | fmt.Printf("Found multiple GraphQL schema for namespace %d.", schema.Namespace) |
| 458 | continue |
| 459 | } |
| 460 | schemaMap[schema.Namespace] = schema.Schema |
| 461 | } |
| 462 | return schemaMap |
| 463 | } |
| 464 | |
| 465 | func readGqlSchema(opt *BulkOptions) []byte { |
| 466 | f, err := filestore.Open(opt.GqlSchemaFile) |
no outgoing calls
no test coverage detected