@@ -93,22 +93,6 @@ func (r *mutationResolver) DgraphDeleteBridge(ctx context.Context, filter interf
93
93
return postGqlProcess (ctx , r .db , data , err )
94
94
}
95
95
96
- /* Raw bridges pass the raw query from the request context to Dgraph.
97
- * @warning: It looses transformation that eventually happen in the resolvers/directives.
98
- * @warning: It is hard to modify the query with this approache
99
- * @deprecated
100
- */
101
-
102
- func (r * queryResolver ) DgraphBridgeRaw (ctx context.Context , data interface {}) error {
103
- err := DgraphQueryResolverRaw (ctx , r .db , data )
104
- return postGqlProcess (ctx , r .db , data , err )
105
- }
106
-
107
- func (r * mutationResolver ) DgraphBridgeRaw (ctx context.Context , data interface {}) error {
108
- err := DgraphQueryResolverRaw (ctx , r .db , data )
109
- return postGqlProcess (ctx , r .db , data , err )
110
- }
111
-
112
96
func getUserQueryType (ctx context.Context ) (* model.UserCtx , string , error ) {
113
97
_ , uctx , err := auth .GetUserContext (ctx )
114
98
if err != nil {
@@ -123,6 +107,9 @@ func getUserQueryType(ctx context.Context) (*model.UserCtx, string, error) {
123
107
return uctx , typeName , err
124
108
}
125
109
110
+ // postGqlProcess postprocess output data and error:
111
+ // - ignore error if data are returned (cause by @auth rules filtering).
112
+ // - handle meta query passed with redis.
126
113
func postGqlProcess (ctx context.Context , db * db.Dgraph , data interface {}, errors error ) error {
127
114
if data != nil && errors != nil {
128
115
// Gqlgen ignore the data if there is an error returned
@@ -170,6 +157,22 @@ func postGqlProcess(ctx context.Context, db *db.Dgraph, data interface{}, errors
170
157
return errors
171
158
}
172
159
160
+ /* Raw bridges pass the raw query from the request context to Dgraph.
161
+ * @warning: It looses transformation that eventually happen in the resolvers/directives.
162
+ * @warning: It is hard to modify the query with this approache
163
+ * @deprecated
164
+ */
165
+
166
+ func (r * queryResolver ) DgraphBridgeRaw (ctx context.Context , data interface {}) error {
167
+ err := DgraphQueryResolverRaw (ctx , r .db , data )
168
+ return postGqlProcess (ctx , r .db , data , err )
169
+ }
170
+
171
+ func (r * mutationResolver ) DgraphBridgeRaw (ctx context.Context , data interface {}) error {
172
+ err := DgraphQueryResolverRaw (ctx , r .db , data )
173
+ return postGqlProcess (ctx , r .db , data , err )
174
+ }
175
+
173
176
// @deprecated: Follow the Gql request to Dgraph.
174
177
// This use raw query from the request context and thus won't propagate change
175
178
// of the input that may happend in the resolvers.
0 commit comments