{"id":26921162,"url":"https://github.com/olyop/objectgraph-go","last_synced_at":"2025-04-01T22:53:45.060Z","repository":{"id":238790152,"uuid":"797570082","full_name":"olyop/objectgraph-go","owner":"olyop","description":"Graphql + Go","archived":false,"fork":false,"pushed_at":"2024-08-23T01:29:57.000Z","size":631,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T04:41:31.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olyop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-08T05:17:13.000Z","updated_at":"2024-08-23T01:30:00.000Z","dependencies_parsed_at":"2024-05-08T06:28:37.777Z","dependency_job_id":"2fadd379-7a38-412b-980d-c4966c090a41","html_url":"https://github.com/olyop/objectgraph-go","commit_stats":null,"previous_names":["olyop/graphql-go","olyop/graphqlops-go","olyop/objectgraph-go"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olyop%2Fobjectgraph-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olyop%2Fobjectgraph-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olyop%2Fobjectgraph-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olyop%2Fobjectgraph-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olyop","download_url":"https://codeload.github.com/olyop/objectgraph-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246724793,"owners_count":20823544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-01T22:53:44.387Z","updated_at":"2025-04-01T22:53:45.040Z","avatar_url":"https://github.com/olyop.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ObjectGraph Go\n\nRepo for development of a GraphQL framework currently named 'ObjectGraph'.\n\nThe goal is to create a framework that simplifies the caching \u0026 data fetching layer in the context of a GraphQL server.\nIt should be as easy as defining a few 'Retreivers' for each data model then using schema annotations to link the data fields and retreivers together any way the developer wants.\nThe ObjectGraph engine will handle linking everything together and resolving queries and caching (authentication in the future).\nIt should not complicate the layer and should work in a predictable schema-first way while also being performant and scalable aimed for serverless invocations.\n\n```graphql\ntype Query {\n\tgetProductByID(productID: UUID!): Product!\n\t\t@retrieve(key: \"Product/ByID\", args: [\"primaryID=$productID\"])\n}\n\ntype Product {\n\tproductID: UUID!\n\t\t@object(key: \"Product/ProductID\")\n\t\t@cache(ttl: \"1d\")\n\n\tname: String!\n\t\t@object(key: \"Product/Name\")\n\t\t@cache(ttl: \"1d\")\n\n\tprice: Int!\n\t\t@object(key: \"Product/Price\")\n\t\t@cache(ttl: \"1d\")\n\n\tpromotionDiscount: Int\n\t\t@object(key: \"Product/PromotionDiscount\")\n\t\t@cache(ttl: \"1d\")\n\n\tpromotionDiscountMultiple: Int\n\t\t@object(key: \"Product/PromotionDiscountMultiple\")\n\t\t@cache(ttl: \"1d\")\n\n\tvolume: Int\n\t\t@object(key: \"Product/Volume\")\n\t\t@cache(ttl: \"1d\")\n\n\tabv: Int\n\t\t@object(key: \"Product/ABV\")\n\t\t@cache(ttl: \"1d\")\n\n\tupdatedAt: Timestamp\n\t\t@object(key: \"Product/UpdatedAt\")\n\t\t@cache(ttl: \"1d\")\n\n\tcreatedAt: Timestamp!\n\t\t@object(key: \"Product/CreatedAt\")\n\t\t@cache(ttl: \"1d\")\n\n\n\tbrand: Brand!\n\t\t@retrieve(key: \"Brand/ByID\", args: [\"primaryID=Product/BrandID\"])\n\t\t@cache(ttl: \"1d\")\n\n\tcategories: [Category!]!\n\t\t@retrieve(key: \"Category/AllByProductID\", args: [\"productID=Product/ProductID\"])\n\t\t@cache(ttl: \"1d\")\n}\n```\n\n```go\ntype RetrieveUser struct{}\n\nfunc (*RetrieveUser) ByID(args objectgraph.RetrieverInput) (*database.User, error) {\n\tuserID := args.PrimaryID.(uuid.UUID)\n\n\tuser, err := database.SelectUserByID(userID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn user, nil\n}\n\nfunc (*RetrieveUser) ByIDs(args objectgraph.RetrieverInput) ([]*database.User, error) {\n\tuserIDs := args.PrimaryID.([]uuid.UUID)\n\n\tusers, err := database.SelectUsersByIDs(userIDs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn users, nil\n}\n\nfunc (*RetrieveUser) Top1000() ([]*database.User, error) {\n\tusers, err := database.SelectTop1000Users()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn users, nil\n}\n```\n\nFor a full example see the [server/graphql/schema](https://github.com/olyop/objectgraph-go/tree/main/server/graphql/schema) directory.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folyop%2Fobjectgraph-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folyop%2Fobjectgraph-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folyop%2Fobjectgraph-go/lists"}