analytics.graphql 1.87 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# ===============================================
# ANALYTICS
# ===============================================

extend type Query {
  analytics: AnalyticsQuery
}

extend type Mutation {
  analytics: AnalyticsMutation
}

# -----------------------------------------------
# QUERIES
# -----------------------------------------------

17 18 19
"""
Queries for Analytics
"""
20
type AnalyticsQuery {
21 22 23
  """
  Fetch list of Analytics providers and their configuration
  """
24
  providers(
25
    "Return only active providers"
26
    isEnabled: Boolean
27
  ): [AnalyticsProvider] @auth(requires: ["manage:system"])
28 29 30 31 32 33
}

# -----------------------------------------------
# MUTATIONS
# -----------------------------------------------

34 35 36
"""
Mutations for Analytics
"""
37
type AnalyticsMutation {
38 39 40
  """
  Update a list of Analytics providers and their configuration
  """
41
  updateProviders(
42
    "List of providers"
43 44 45 46 47 48 49 50
    providers: [AnalyticsProviderInput]!
  ): DefaultResponse @auth(requires: ["manage:system"])
}

# -----------------------------------------------
# TYPES
# -----------------------------------------------

51 52 53
"""
Analytics Provider
"""
54
type AnalyticsProvider {
55
  "Is the provider active"
56
  isEnabled: Boolean!
57 58

  "Unique identifier for this provider"
59
  key: String!
60 61

  "List of configuration properties, formatted as stringified JSON objects"
62
  props: [String]
63 64

  "Name of the provider"
65
  title: String!
66 67

  "Short description of the provider"
68
  description: String
69 70

  "Is the provider available for use"
71
  isAvailable: Boolean
72 73

  "Path to the provider logo"
74
  logo: String
75 76

  "Website of the provider"
77
  website: String
78 79 80

  "Configuration values for this provider"
  config: [KeyValuePair]
81
}
82 83 84 85

"""
Analytics Configuration Input
"""
86
input AnalyticsProviderInput {
87
  "Is the provider active"
88
  isEnabled: Boolean!
89 90

  "Unique identifier of the provider"
91
  key: String!
92 93

  "Configuration values for this provider"
94 95
  config: [KeyValuePairInput]
}