I am following the tutorial reactnative with phoenix , after setting up my initial setup , I wrote the following code in the Router.ex
scope "/api", do pipe_through :api forward "/graphql", Absinthe.Plug, schema: CroonkWeb.Schema if Mix.env == :dev do forward "/graphiql", Absinthe.Plug.Graphiql, schema: CroonkWeb.Schema end end
while compiling it throws the error,
Compilation error in file lib/croonk_web/router.ex == ** (SyntaxError) lib/croonk_web/router.ex:8: unexpected token: do. In case you wanted to write a "do" expression, you must either use do-blocks or separate the keyword argument with comma. For example, you should either write: if some_condition? do :this else :that end or the equivalent construct: if(some_condition?, do: :this, else: :that) where "some_condition?" is the first argument and the second argument is a keyword list (elixir) lib/kernel/parallel_compiler.ex:208: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
I followed everything as per the tutorial ,it works better in the tutorial . In tutorial they are using phoenix 1.3 Iam using Phoenix 1.4… Please help me overcome this. thanks.