Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ Example:
```

<a name="other"></a>
## Some other queries and arguments
## Some other queries and arguments

### Mapping query
Mapping query simply returns all fields under a doc type. Example:
Expand Down Expand Up @@ -1086,7 +1086,7 @@ Result:
{
"errors": [
{
"message": "You don't have access to following resources: [/programs/external/projects/test]",
"message": "You don't have access to all the data you are querying. Try using 'accessibility: accessible' in your query",
"locations": [
{
"line": 2,
Expand All @@ -1100,7 +1100,7 @@ Result:
"code": 401,
"exception": {
"stacktrace": [
"Error: You don't have access to following resources: [/programs/external/projects/test]",
"Error: You don't have access to all the data you are querying. Try using 'accessibility: accessible' in your query",
...
}
```
Expand Down
7 changes: 3 additions & 4 deletions src/components/Utils/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const nestedHistogramQueryStrForEachField = (mainField, numericAggAsText) => (`
key
count
}
}
}
}
}`);

Expand Down Expand Up @@ -167,11 +167,11 @@ const queryGuppyForRawDataAndTotalCounts = (
}
const processedFields = fields.map((field) => rawDataQueryStrForEachField(field));
const query = `${queryLine}
${dataTypeLine}
${dataTypeLine}
${processedFields.join('\n')}
}
_aggregation {
${typeAggsLine}
${typeAggsLine}
_totalCount
}
}
Expand Down Expand Up @@ -333,7 +333,6 @@ export const downloadDataFromGuppy = (
});
};


export const askGuppyForTotalCounts = (
path,
type,
Expand Down
4 changes: 3 additions & 1 deletion src/server/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ const downloadRouter = async (req, res, next) => {
);
// if requesting resources > allowed resources, return 401,
if (outOfScopeResourceList.length > 0) {
throw new CodedError(401, `You don't have access to following resources: [${outOfScopeResourceList.join(', ')}]`);
log.info('[download] requesting out-of-scope resources, return 401');
log.info(`[download] the following resources are out-of-scope: [${outOfScopeResourceList.join(', ')}]`);
throw new CodedError(401, 'You don\'t have access to all the data you are querying. Try using \'accessibility: accessible\' in your query');
} else { // else, go ahead download
appliedFilter = filter;
}
Expand Down
6 changes: 3 additions & 3 deletions src/server/middlewares/tierAccessMiddleware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ const tierAccessResolver = (
resolve, root, args, context, info, authHelper, filter,
);
}
log.debug('[tierAccessResolver] requesting out-of-scope resources, return 401');
throw new ApolloError(`You don't have access to following resources: \
[${outOfScopeResourceList.join(', ')}]`, 401);
log.info('[tierAccessResolver] requesting out-of-scope resources, return 401');
log.info(`[tierAccessResolver] the following resources are out-of-scope: [${outOfScopeResourceList.join(', ')}]`);
throw new ApolloError('You don\'t have access to all the data you are querying. Try using \'accessibility: accessible\' in your query', 401);
}

/**
Expand Down