2
0

query_location.go 877 B

12345678910111213141516171819202122232425262728293031323334
  1. package graphql
  2. import (
  3. "context"
  4. "github.com/gshopify/service-wrapper/model"
  5. "github.com/gshopify/service-wrapper/server/middleware"
  6. "gshopper.com/gshopify/shop/graphql/generated"
  7. )
  8. func (r *entityResolver) FindLocationByID(ctx context.Context, id string) (*generated.Location, error) {
  9. var (
  10. inContext *middleware.GShopifyContext
  11. rawId string
  12. err error
  13. )
  14. inContext, err = middleware.InContext(ctx)
  15. if err != nil {
  16. return nil, err
  17. }
  18. rawId, err = model.ParseId(model.GidLocation, id)
  19. if err != nil {
  20. return nil, err
  21. }
  22. return r.db.Location(inContext.Language, rawId)
  23. }
  24. func (r *queryResolver) Locations(ctx context.Context,
  25. after *string, before *string, first *int, last *int, near *generated.GeoCoordinateInput, reverse *bool, sortKey *generated.LocationSortKeys,
  26. ) (*generated.LocationConnection, error) {
  27. panic("not implemented")
  28. }