I can't use secrets using GraphQL on Prefect Server - it throws an error GRAPHQL_VALIDATION_FAILED - why?

View in #prefect-server on Slack

David_Charles @David_Charles: Hi I’m having a problem setting secrets using GQL (same with Python client):

mutation {
  set_secret(input: { name: "FOO", value: "BAR" }) {


  "errors": [
      "message": "Cannot query field \"set_secret\" on type \"Mutation\".",
      "locations": [
          "line": 2,
          "column": 3
      "extensions": {

Any ideas?
Version info here:

  "data": {
    "api": {
      "backend": "SERVER",
      "mode": "normal",
      "version": "2022.01.25",
      "core_version": "0.15.13",
      "release_timestamp": "2022-01-25T17:43:26Z"

Python client:

import prefect

@Anna_Geller: Hi @David_Charles, the Secrets stored in the backend are only available using Prefect Cloud, i.e. you can’t use those on Prefect Server since this requires a managed service to ensure those Secrets are properly encrypted and stored in a secure manner. On Server you can leverage local Secrets. Check out this Discourse topic to see how you can set local Secrets https://discourse.prefect.io/t/how-to-set-secrets-e-g-github-access-token-on-server/70

Prefect Community: How to set Secrets (e.g. GITHUB_ACCESS_TOKEN) on Server?

David_Charles @David_Charles: Ahhhh - thanks (thought I’d lost the plot)
Understood - thanks for the snappy reply @Anna_Geller :slightly_smiling_face: