diff --git a/src/app/views/query-runner/query-input/QueryInput.tsx b/src/app/views/query-runner/query-input/QueryInput.tsx index bc0414c2c..2a46fe861 100644 --- a/src/app/views/query-runner/query-input/QueryInput.tsx +++ b/src/app/views/query-runner/query-input/QueryInput.tsx @@ -61,7 +61,7 @@ const QueryInput = (props: IQueryInputProps) => { } const runQuery = () => { - if (!sampleQuery.sampleUrl) { + if (!sampleQuery.sampleUrl || sampleQuery.sampleUrl.indexOf('graph.microsoft.com') === -1) { return; } handleOnRunQuery(sampleQuery); diff --git a/src/app/views/query-runner/query-input/auto-complete/auto-complete.util.ts b/src/app/views/query-runner/query-input/auto-complete/auto-complete.util.ts index 6a80f71b5..9e348e7f2 100644 --- a/src/app/views/query-runner/query-input/auto-complete/auto-complete.util.ts +++ b/src/app/views/query-runner/query-input/auto-complete/auto-complete.util.ts @@ -51,6 +51,9 @@ function getErrorMessage(queryUrl: string) { if (error) { return `${translateMessage('Possible error found in URL near')}: ${error}`; } + if (queryUrl.indexOf('graph.microsoft.com') === -1){ + return translateMessage('The URL must contain graph.microsoft.com'); + } return ''; } diff --git a/src/messages/GE.json b/src/messages/GE.json index 551d25ef1..73c731785 100644 --- a/src/messages/GE.json +++ b/src/messages/GE.json @@ -470,5 +470,6 @@ "Permission propagation delay": "Permission propagation delay", "Scope consent successful": "Scope consent successful", "Query documentation": "Query documentation", - "This token is not a jwt token and cannot be decoded by jwt.ms": "This token is not a jwt token and cannot be decoded by jwt.ms" + "This token is not a jwt token and cannot be decoded by jwt.ms": "This token is not a jwt token and cannot be decoded by jwt.ms", + "The URL must contain graph.microsoft.com": "The URL must contain graph.microsoft.com" } \ No newline at end of file