Skip to content

Commit

Permalink
Add missing :min to selection set refs
Browse files Browse the repository at this point in the history
Fixes the following exception "No implementation of method: :-unparse of
protocol: #'oksa.alpha.protocol/Serializable found for class: nil".

The fix is to require a selection set in these cases since this is what
the GraphQL spec also says.
  • Loading branch information
Ilmo Raunio committed Jun 7, 2024
1 parent 80bd149 commit a8646af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/oksa/parse.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
[:on [:ref ::Name]]
[:directives {:optional true}
[:schema [:ref ::Directives]]]]
[:repeat {:max 1} [:schema [:ref ::SelectionSet]]]]
[:repeat {:min 1 :max 1} [:schema [:ref ::SelectionSet]]]]
::OperationDefinition [:or
[:cat
[:enum :oksa/query :oksa/mutation :oksa/subscription]
Expand All @@ -61,7 +61,7 @@
[:schema [:ref ::VariableDefinitions]]]
[:directives {:optional true}
[:schema [:ref ::Directives]]]]]
[:repeat {:max 1} [:schema [:ref ::SelectionSet]]]]
[:repeat {:min 1 :max 1} [:schema [:ref ::SelectionSet]]]]
[:schema [:ref ::SelectionSet]]]
::VariableDefinitions [:orn [::VariableDefinitions
[:+ [:cat
Expand Down Expand Up @@ -149,7 +149,7 @@
[:ref ::Directives]]
[:on {:optional true}
[:ref ::Name]]]]
[:repeat {:max 1} [:schema [:ref ::SelectionSet]]]]
[:repeat {:min 1 :max 1} [:schema [:ref ::SelectionSet]]]]
::Alias [:schema [:ref ::Name]]
::Name (if (:oksa/strict opts)
[:and [:or :keyword :string]
Expand Down

0 comments on commit a8646af

Please sign in to comment.