code: func ConvertQuery(request *http.Request, q query.Query) *app.Query {
  	spaceID := q.SpaceID.String()
  	relatedURL := rest.AbsoluteURL(request, app.QueryHref(spaceID, q.ID))
  	creatorID := q.Creator.String()
  	relatedCreatorLink := rest.AbsoluteURL(request, fmt.Sprintf("%s/%s", usersEndpoint, creatorID))
  	spaceRelatedURL := rest.AbsoluteURL(request, app.SpaceHref(spaceID))
  	appQuery := &app.Query{
  		Type: query.APIStringTypeQuery,
  		ID:   &q.ID,
  		Attributes: &app.QueryAttributes{
  			Title:     q.Title,
  			Fields:    q.Fields,
  			CreatedAt: &q.CreatedAt,
  			Version:   &q.Version,
  		},
  		Links: &app.GenericLinks{
  			Self:    &relatedURL,
  			Related: &relatedURL,
  		},
  		Relationships: &app.QueryRelations{
  			Creator: &app.RelationGeneric{
  				Data: &app.GenericData{
  					Type: ptr.String(APIStringTypeUser),
  					ID:   &creatorID,
  					Links: &app.GenericLinks{
  						Related: &relatedCreatorLink,
  					},
  				},
  			},
  			Space: &app.RelationGeneric{
  				Data: &app.GenericData{
  					Type: &space.SpaceType,
  					ID:   &spaceID,
  				},
  				Links: &app.GenericLinks{
  					Self:    &spaceRelatedURL,
  					Related: &spaceRelatedURL,
  				},
  			},
  		},
  	}
  	return appQuery
  }
docs: // ConvertQuery converts from internal to external REST representation